Skip to content

Instantly share code, notes, and snippets.

@gregeng
Created September 25, 2013 04:22
Show Gist options
  • Save gregeng/6695140 to your computer and use it in GitHub Desktop.
Save gregeng/6695140 to your computer and use it in GitHub Desktop.
SQL statements for magical.db and artists.db
--magical.db
--01_create_wizards.sql
CREATE TABLE wizards(
name TEXT,
age INTEGER
);
--02_add_color_to_wizards.sql
ALTER TABLE wizards ADD COLUMN color TEXT;
-------------------------------------------------------
-------------------------------------------------------
--artists.db
--02_create_table_artists.sql
CREATE TABLE artists(
name TEXT,
age INTEGER,
number_of_hit_songs INTEGER,
most_popular_song TEXT,
highest_billboard_ranking REAL
);
--03_alter.sql
ALTER TABLE artists ADD COLUMN hometown TEXT;
ALTER TABLE artists ADD COLUMN biggest_idol TEXT;
--04_drop_column.sql
DROP TABLE artists;
CREATE TABLE artists(
name TEXT,
age INTEGER,
most_popular_song TEXT,
highest_billboard_ranking REAL
hometown TEXT,
biggest_idol TEXT
);
--05_rename.sql
ALTER TABLE artists RENAME TO musicians;
--06_drop_table.sql
DROP TABLE musicians;
@gregeng
Copy link
Author

gregeng commented Sep 25, 2013

Download the .db files at:

https://db.tt/YpPxKWrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment