SQLite Forum

Help with foreign key
Login
Thank you Larry.  I am completely new to this and a single mom. I started a small cleaning business from home after getting laid off and I thought having a small database would be helpful.  I looked at what you sent and I appreciate it, but I don't understand my error.  I did find this and thought it should work the same for me: (https://www.sqlite.org/foreignkeys.html)

CREATE TABLE artist(
  artistid    INTEGER PRIMARY KEY, 
  artistname  TEXT
);
CREATE TABLE track(
  trackid     INTEGER,
  trackname   TEXT, 
  trackartist INTEGER REFERENCES artist

So in the end, not sure why it does not work.

Thank you for advice Larry