Copying tables from a .sql to a .db file.. Learn SQL The Hard Way
I ran into this exact problem, and I have never touched SQLite before. Here are more instructions for people in the future.
In a text editor, create ex1.sql
. This is the file that will be used to create the .db
when the command sqlite3 ex1.db < ex1.sql
is run.
ex1.sql
CREATE TABLE person ( id INTEGER PRIMARY KEY, first_name TEXT, last_name TEXT, age INTEGER);
Make sure to save this file in the same folder as the sqlite3.exe
file you downloaded. You can now run the aforementioned command and you are good to go!