For pset7 - finance I am trying to create a new table to keep track of buy transactions. Since I want this table to have a foreign key (referencing the 'id' in the 'users' table) and I understood that this is not possible via the PhpLiteAdmin interface I want to create the table via the command-line.
This is an example line of code:
sqlite> CREATE TABLE portfolio (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, first TEXT NOT NULL, last TEXT NOT NULL);
And with schema I can see the table is created:
sqlite> .schema
CREATE TABLE portfolio (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, first TEXT NOT NULL, last TEXT NOT NULL);
However, the table does not appear in my finance.db file, so it is stored somewhere else.
Furthermore, when I try to do the following command, to specify that it should be a table within the database 'finance' it says that this database is unknown:
sqlite> CREATE TABLE finance.portfolio (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, first TEXT NOT NULL, last TEXT NOT NULL);
Error: unknown database finance
Does anybody have an idea where this is coming from and how to solve it?
sqlite3
?.load
command in the programme, and also attach additional databases.