开发day6

今天弄了数据库

目前APP共涉及到三个表,分别是:用户信息表、配置表、收支明细表

public void onCreate(SQLiteDatabase db){
    //user table
    db.execSQL("create table if not exists user_tb(_id integer primary key autoincrement," +
            "userID text not null," +
            "pwd text not null)");

    //Configuration table
    db.execSQL("create table if not exists refCode_tb(_id integer primary key autoincrement," +
            "CodeType text not null," +
            "CodeID text not null," +
            "CodeName text null)");

    //costDetail_tb
    db.execSQL("create table if not exists basicCode_tb(_id integer primary key autoincrement," +
            "userID text not null," +
            "Type integer not null," +
            "incomeWay text not null," +
            "incomeBy text not null," +
            "category text not null," +
            "item text not null," +
            "cost money not null," +
            "note text not null," +
            "makeDate text not null)");
}

要快点!快开学了555555

原文地址:https://www.cnblogs.com/Aming-/p/12323374.html