智慧职教: 以下是按商品id删除商品信息的方法,请把程序补充完整: public int delete(long id){ SQLiteDatabase db=helper.getWritableDatabase(); int result=db.delete("account","_id=?",_____________); db.close(); return result; }
举一反三
- 在创建SQLiteOpenHelper的子类后,在子类哪个方法是用来更新库?( ) A: MySQLite() B: onCreate(SQLiteDatabase db) C: onUpgrade(SQLiteDatabase db,int old) D: onUpgrade(SQLiteDatabase db,int old,int new)
- 在数据表employee中根据id删除员工信息,下列@Delete注解的写法正确的是()。 A: @Delete("delete from employee where id = ?") B: @Delete("delete from employee") C: @Delete( delete from employee where id = D: {id} ) E: 以上说法都不正确
- 删除student表中id为1的记录,下列语句正确的是 A: DELETE student WHERE id=1; B: DELETE FROM student WHERE id=1; C: DELETE FROM student WHERE id:=1; D: DELETE student WHERE id:=1;
- 删除student表中id为1的记录() A: TRUNCATE FROM student where id=1; B: DELETE student where id=1; C: DELETE FROM student where id=1; D: DELETE INTO student where id=1;
- 下列关于删除表中记录的SQL语句,正确的是( )。 A: DELETE student,where id=11; B: DELETE FROM student where id=11; C: DELETE INTO student where id=11; D: DELETE student where id=11;