我在这里寻求帮助,我已经知道如何创建数据库但现在我要做的就是添加外键,错误是日志 cat 指示 _Lien_parenté_CM 附近的语法错误,解决方案是什么?
private static final String MENAGE = "table_MENAGE";
private static final String _id = "Numero_du_Questionnaire";
private static final String _idquest = "Numero_Question";
private static final String _idquesting = "Numero_Quest";
private static final String col_Code_district = "Code_district";
private static final String col_Region= "region";
private static final String col_Provence_prefecture = "provence_prefecture";
private static final String Membres_de_Menage = "table_Membre_Menage";
private static final String col_N_Ordre = "Numero_Ordre";
private static final String col_Nom_prénom = "Nom_prénom";
private static final String col_Lien_parenté_CM = "Lien_parenté_CM";
private static final String col_Sexe = "Sexe";
private static final String col_Age = "Age ";
private static final String col_Langue_maternelle = "Langue_maternelle ";
private static final String col_Lieu_naissance = "Lieu_naissance ";
private static final String col_Niveau_instruction = "Niveau_instruction ";
private static final String col_branche_activité = "branche_activité ";
android.database.sqlite.SQLiteException: near "Lien_parenté_CM": syntax error (code 1): , while compiling: CREATE TABLE table_Membre_Menage ( Numero_Ordre INT NOT NULL PRIMARY KEY, Nom_prénom TEXT,Numero_Quest integer, FOREIGN KEY (Numero_Quest ) REFERENCES table_MENAGE (Numero_du_Questionnaire ),Lien_parenté_CM INT,Sexe INT,Age INT,Langue_maternelle INT,Lieu_naissance INT,Niveau_instruction INT,branche_activité INT)
private static final String DATABASE_CREATE1 = "CREATE TABLE " + MENAGE + "( " + _id +" INTEGER PRIMARY KEY AUTOINCREMENT,"
+ col_Region +" TEXT,"+ col_Provence_prefecture +" TEXT,"
+ col_Commune_Arrondissement +" TEXT,"+ col_N_district +" INT ");
private static final String DATABASE_CREATE3 = "CREATE TABLE "+Membres_de_Menage+" ( " +col_N_Ordre+" INT NOT NULL PRIMARY KEY, "+col_Nom_prénom+" TEXT," + _idquesting + " integer, "
+ " FOREIGN KEY ("+ _idquesting +" ) REFERENCES "+MENAGE+" ("+_id+ ")," +col_Lien_parenté_CM+" INT,"+col_Sexe+" INT,"+col_Age+" INT,"+col_Langue_maternelle+" INT,"
+col_Lieu_naissance+" INT,"+col_Niveau_instruction+" INT,"+col_branche_activité+" INT ");