在SC表中添加约束,限定成绩Grade的取值范围为0-100,将下面的SQL语句补充完整。正确的选项是( )。 Alter Table SC Add CJ (Grade>=0 And Grade<=100)
举一反三
- 已知表xk(sno,cno,grade),创建规则,限定grade的范围在0-100之间,其正确语句为( ) A: create rule gradeRuleas @grade between 0 and 100 B: create gradeRuleas @grade between 0 and 100 C: create rule gradeRuleas grade between 0 and 100 D: create gradeRuleas grade between 0 and 100
- 在“学生-课程”数据库中,当定义SC表时对字段Grade进行约束:Grade SMALLINT CHECK (Grade>=0 AND Grade<=100),如果SC表中原有记录('201215121','7',92),那么当执行"UPDATE SC SET Grade=Grade+10"时,数据库和DBMS将___________。 A: SC表数据不变,DBMS报错不允许更新 B: 记录('201215121','7',92)更新为('201215121','7',100),DBMS提醒Grade值不能超过100 C: 记录('201215121','7',92)更新为('201215121','7',NULL),DBMS提醒Grade值不能超过100 D: SC表数据不变,DBMS显示语句语法正确
- “把查询sc表和更新sc表的grade列的权限受予用户user1”的正确SQL语句是()。 A: GRANT SELECT, UPDATE(gradON TABLE sc TO user1 B: GRANT SELECT sc, UPDATE sc, grade TO user1 C: GRANT SELECT, UPDATE ON TABLE s grade TO user1 D: GRANT SELECT ON TABLE sc, UPDATE ON TABLE sc(grad TO user1
- “把查询SC表和更新SC表的grade列的权限授予用户user”的正确SQL语句是( )。 A: GRANT SELECT sc.UPDATE sc.grade TO user B: GRANT SELECT,UPDATE(grade)ON TABLE sc TO user C: GRANT SELECT,UPDATE ON TABLE sc.grade TO user D: GRANT SELECT ON TABLE sc,UPDATE ON TABLE sc(grade)TO user
- 下面选项中,能够更新表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;