Daniel Sibaja
Daniel Sibaja

Reputation: 1367

Sqlite3 database Create Table Error

Well Hello guys, I'm working on an android app with an sqlite3 database, can you please help me to debug this code, because it says syntax error and I can't find the error.

"CREATE TABLE cancion(id INTEGER PRIMARY KEY, name TEXT, genre_id INTEGER, singer_id INTEGER," +
            " FOREING KEY (genre_id) REFERENCES genre(id)," +
            " FOREING KEY (singer_id) REFERENCES singer(id));";
    String queryGenero = "CREATE TABLE genre(id INTEGER PRIMARY KEY, name TEXT);";
    String querySinger = "CREATE TABLE singer(id INTEGER PRIMARY KEY, name TEXT);";

Upvotes: 1

Views: 82

Answers (1)

Szymon
Szymon

Reputation: 43023

You have a typo in: FOREING should be FOREIGN

Upvotes: 4

Related Questions