当前位置:首页 > SQLServer单科测试题(带答案)
B.INSERT INTO students (sID,sName,birthday) VALUES (1,‘李刚’,‘1999-01’,80)
C.INSERT INTO students VALUES(1,李刚,1999-01-01,80)
D.INSERT INTO students (sID,sName,birthday) VALUES(NULL,‘李刚’, ‘1999-01-01’)
41.现有表user,字段:
userid,username, salary, deptid,email;表department,字段: deptid,deptname;下面()应采用检查约束来实现。
A.若department中不存在deptid为2的纪录,则不允许在user表中插入deptid为2的数据行
B.若user表中已经存在userid为10的记录,则不允许在user表中再次插入userid为10的数据行
C.User表中的salary(薪水)值必须在1000元以上
D.若User表的email列允许为空,则向user表中插入数据时,可以不输入email值
42.现有表book,字段:
id (int),title (varchar), price (float);其中id字段设为标识,使用insert语句向book表中插入数据,以下语句错误的是()。
A.insert into book (id,title,price) values(1,'java',100) B.insert into book (title,price) values('java',100) C.insert into book values ('java',100) D.insert book values('java',100)
13 / 16
43.成绩表grade中字段score代表分数,以下()语句返回成绩表中的最低分。[选两项]
A.select max(score) from grade
B.select top 1 score from grade order by score asc C.Select min(score) from grade
D.select top 1 score from grade order by score desc
44.select * from students where SNO like‘010_[^0]%[A-C]%’,可能会查询出的SNO是()。[选两项]
A.A B.A01 C.D09 D.01A01
45.在SQlServer数据库中,现有student_info(学生)表,其中包括字段: stu_name(姓名,varcher型),stu_id(学号,int型),stu_grade(成绩,int型).现在需要查询成绩为80分的学生姓名,并且结果按照学号降序排列。下面查询语句正确的是()。
A.Select stu_name from student_info where stu_grade=80 order by stu_id B.Select stu_name from student_info where stu_grade=80 order by stu_id desc C.Select stu_name from student_info where stu_grade like 80 group by stu_id D.Select stu_name from student_info where stu_grade=80 order by stu_id asc 46.顾客表(customer)中有如下信息: cid1234Cname Jack
14 / 16
Lee Tom ChenCity Null Beijing Beijing
--------------------------------------装--------------------------------------订------------------------------
----------------------------------------线Select count(City),count(*) from customer,执行的结果为()。
A.4,4 B.2,2 C.3,4 D.2,4
47.当进行分组查询时,在select后可以出现()。[选两项] A.表中的任意列 B.分组的列 C.聚合函数 D.表中的所有列
48.在insert语句中若要向某列插入默认值,应该使用()。 A.null B.value
15 / 16
C.default D.join
49.关于truncate table说法正确的是()。 A.truncate table可以用于删除表的部分数据 B.truncate table在删除数据比delete速度快
C.使用truncate table删除表数据后,对表中标识列没有影响 D.truncate table可以用于删除表的结构 50.以下()约束不是用于实施域完整性。 A.非空约束 B.外键约束 C.唯一约束 D.默认值
16 / 16
共分享92篇相关文档