Skip to content

Instantly share code, notes, and snippets.

@BandanaKM
Last active December 23, 2015 21:19
Show Gist options
  • Save BandanaKM/6695038 to your computer and use it in GitHub Desktop.
Save BandanaKM/6695038 to your computer and use it in GitHub Desktop.
sql book assignment
🐧 mkdir artist
[23:36:02] ~
🐧 cd artist
[23:36:06] artist
🐧 sqlite artist.sql
-bash: sqlite: command not found
[23:36:52] artist
🐧 sqlite3 artist.sql
SQLite version 3.7.17 2013-05-20 00:56:22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> CREATE TABLE artists(
...> name TEXT;
Error: near ";": syntax error
sqlite> CREATE TABLE artists(
...> name TEXT,
...> genre TEXT,
...> era INTEGER,
...> collaborators TEXT);
sqlite> ALTER TABLE artists ADD COLUMN country TEXT;
sqlite> ALTER TABLE artists ADD COLUMN ontour TEXT;
sqlite> DROP COLUMN collaborators;
Error: near "COLUMN": syntax error
sqlite> ALTER TABLE artists DROP COLUMN collaborators TEXT;
Error: near "DROP": syntax error
sqlite> DROP TABLE artists;
sqlite> CREATE TABLE artists(
...> name TEXT,
...> genre TEXT,
...> era INTEGER,
...> country TEXT);
sqlite> ALTER TABLE artists RENAME TO musicians;
sqlite> DROP TABLE musicians;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment