Sqlite3数据库创建表错误

时间:2013-10-18 05:38:17

标签: android database sqlite

好的大家好,我正在开发一个带有sqlite3数据库的android应用程序,请你帮我调试一下这段代码,因为它说语法错误,我找不到错误。

"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);";

1 个答案:

答案 0 :(得分:4)

您输入的拼写错误:FOREING应为FOREIGN