package com.example.android.waitlist.data;

// TODO (1) extend the SQLiteOpenHelper class
public class WaitlistDbHelper {

    // TODO (2) Create a static final String called DATABASE_NAME and set it to "waitlist.db"

    // TODO (3) Create a static final int called DATABASE_VERSION and set it to 1

    // TODO (4) Create a Constructor that takes a context and calls the parent constructor

    // TODO (5) Override the onCreate method

        // TODO (6) Inside, create an String query called SQL_CREATE_WAITLIST_TABLE that will create the table

        // TODO (7) Execute the query by calling execSQL on sqLiteDatabase and pass the string query SQL_CREATE_WAITLIST_TABLE

    // TODO (8) Override the onUpgrade method

        // TODO (9) Inside, execute a drop table query, and then call onCreate to re-create it

}
@@ -41,85 +41,1272 @@
 a;%0A%0A
-// TODO (1) extend the SQLiteOpenHelper class%0Apublic class WaitlistDbHelper %7B
+import android.content.Context;%0Aimport android.database.sqlite.SQLiteDatabase;%0Aimport android.database.sqlite.SQLiteOpenHelper;%0Aimport com.example.android.waitlist.data.WaitlistContract.WaitlistEntry;%0A%0A// TODO (1) extend the SQLiteOpenHelper class%0Apublic class WaitlistDbHelper extends SQLiteOpenHelper %7B%0A%0A    public static final String DATABASE_NAME = %22waitlist.db%22;%0A%0A    public static final int DATABASE_VERSION = 1;%0A%0A    public WaitlistDbHelper(Context context) %7B%0A        super(context, DATABASE_NAME, null, DATABASE_VERSION);%0A    %7D%0A%0A    @Override%0A    public void onCreate(SQLiteDatabase db) %7B%0A        String SQL_CREATE_WAITLIST_TABLE= %22CREATE TABLE %22 +%0A                WaitlistEntry.TABLE_NAME + %22(%22 +%0A                WaitlistEntry._ID + %22 INTEGER PRIMARY KEY AUTOINCREMENT, %22 +%0A                WaitlistEntry.COLUMN_GUEST_NAME + %22 TEXT NOT NULL, %22 +%0A                WaitlistEntry.COLUMN_PARTY_SIZE + %22 INTEGER NOT NULL, %22 +%0A                WaitlistEntry.COLUMN_TIMESTAMP + %22 TIMESTAMP DEFAULT CURRENT_TIMESTAMP)%22;%0A        db.execSQL(SQL_CREATE_WAITLIST_TABLE);%0A    %7D%0A%0A    @Override%0A    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) %7B%0A        db.execSQL(%22DROP TABLE IF EXISTS %22 + WaitlistEntry.TABLE_NAME);%0A        onCreate(db);%0A    %7D
 %0A%0A  

Complete TODOs for T07.02 CreateTheDatabase exercise