举一反三
- 为goods表中商品号(GID)创建唯一性索引。(判断以下SQL语句是否正确)ALTER TABLE goods ADD DEFAULT INDEX sy1(GID);
- ①创建触发器NEW_sale_gsaves,实现:当某种商品被客户退货时,即向salerecord表删除记录,那么应在goods表中的库存(Gsaves)自动加上相应salerecord表删除记录的销售数量(Snumber)。②向salerecord删除数据(003,A001,2),验证goods表中Gsaves是否发生改变。
- 将学生张三从编号为001的系转到编号为002的系,应使用的SQL语句( )。 A: Updata 学生Set 系编号= ‘002’ B: Update 学生 set 系编号=’002’ Where 姓名=’张三’ and 系编号=’001’ C: Update 学生 set 系编号=’002’ Where 姓名=’张三’ D: Update 学生 系编号=’002’ Where系编号=’001'
- 下面选项中,用于将表user中字段age值更新为55的SQL语句是 A: ALTER TABLE user set age=55; B: UPDATE user set age=55 where age=55; C: UPDATE user set age=55; D: UPDATE user set age=55 where age<=55;
- 下面选项中,用于将表student中字段grade值更新为80的SQL语句是( ) A: ALTER TABLE student set grade=80; B: UPDATE student set grade=80 where grade=80; C: UPDATE student set grade=80 where grade<=80; D: UPDATE student set grade=80;
内容
- 0
下面选项中,能够更新user表中数据的SQL语句是() A: update into user set id = 'u001'; B: update user set id = 'u001' and username='jack'; C: update user set username='jack' where id = 1; D: update into user set id = 'u001', username='jack';
- 1
下面选项中,能够更新表student中id值小于4的SQL语句是() A: ALTER TABLE student where id<4; B: UPDATE student set grade=100 where id<4; C: UPDATE student set grade=100 where id<=4; D: UPDATE Table student set grade=100 where id<4;
- 2
删除Goods表中,g_ID='040002'的商品信息语句是_______ from Goods where g_ID='040002'
- 3
要查询Goods表中商品中含有“电冰箱”的商品情况,可用( ) A: SELECT * FROM Goods WHERE g_Name LIKE '电冰箱%' B: SELECT * FROM Goods WHERE g_Name LIKE '电冰箱_' C: SELECT * FROM Goods WHERE g_Name LIKE '%电冰箱%' D: SELECT * FROM Goods WHERE g_Name='电冰箱'
- 4
对update goods set weight=weight+5 where gno='2016001'与 update goods set weight=weight+5 两条语句的差异,描述错误的是( ) A: 第一条语句是把特定记录的weight值增加了5 B: 第二条语句是把所有记录的weight值增加了5 C: goods是被修改数据的表的名字 D: weight不是被修改的字段名字