Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Android Data Persistence Using SQLite for Structured Data Creating a SQLite Table

Next, add another create statement called CREATE_CAR_MODELS that is public static final. Give it a primary key called _i

dont kno whts wrong with my code, anyone to help

AutoSQLiteHelper.java
public class AutoSQLiteHelper extends SQLiteOpenHelper {
 public static final String COLUMN_COMPANY_NAME = "COMPANY_NAME";
 public static final String COLUMN_CAR_MODELS = "CAR_MODELS"; 

 public static final String CREATE_CAR_MAKERS = 
  "CREATE TABLE CAR_MAKERS (_id INTEGER PRIMARY KEY AUTOINCREMENT, " + COLUMN_COMPANY_NAME + "TEXT)";

 public static final String CREATE_CAR_MODELS = 
  "CREATE TABLE CAR_MODELS (_id INTEGER PRIMARY KEY AUTOINCREMENT, " + COLUMN_CAR_MODELS + " TEXT)";

  @Override
  public void onCreate(SQLiteDatabase database) {
    database.execSQL(CREATE_CAR_MAKERS);
    database.execSQL(CREATE_CAR_MODELS);
  }
}
Marco Barbaro
Marco Barbaro
3,106 Points

You have to add a TEXT field called CAR_NAME and I don't see it in your code ;-)