数据库复习及联系资料(3)

2019-04-23 13:23

77.SELECT FLOOR(-14.7), FLOOR(14.7) ( A )

A、-15,14 B、-15,15 C、-14,14 D、-14,15

78.下面哪个可以是用来获取当前日期的函数( B )

A、currentdate() B、current_date() C、current_year() D、current_month()

79.下面哪个函数是mysql获取当前日期的函数( C ) A、addyear() B、month() C、localtime() D、year()

80.下列集函数中不忽略空值(NULL)的是(A)

A、COUNT(*) B、MAX(列名) C、SUM(列名) D、AVG(列名)

81.运行一下SQL语句,将输出( c )

SELECT REPLACE('你好,我是Tom','你','您') a) 你好,我是Tom b) 你您好,我是Tom c) 您好,我是Tom d) 您你好,我是Tom

82.T-SQL中要查询班级中年龄最大的学员,可能用到如下(a)函数(选择一项)

a) MAX() b) MIN() c) AVG() d) SUM()

83.在SQL Server中,下列表达式为T-SQL模糊查询语句的一部分,其中(b )

可用于从数据库表中查询全部地址(字段名为Address)中包含“海淀区”的信息。(选择一项)

a.Address like ‘海淀区’ b.Address like ‘%海淀区%’ c.Address like ‘海淀区%’ d.Address ‘海淀区%’

84.若想统计各个工种的人数与平均工资,正确的语句是(C)

A、select job,mgr,count(*),avg(sal) from emp group by job ; B、select job,ename,count(*),avg(sal) from emp group by job ; C、select job,count(*),avg(sal) from emp group by job ; D、select job,count(*) from emp group by job ;

85.下面关于子查询叙述正确的是( A )

A、子查询是一个查询语句嵌套在另一个查询语句内部的查询。 B、子查询不可以使用比较运算符 C、子查询只会产生一个值

D、一个select语句中只能包含嵌套一层

86.关于子查询与操作符的使用,说法不正确的是(A)

A、子查询不能和IN操作符结合使用 B、子查询可以和IN操作法结合使用 C、子查询可以和等于(=)操作符使用

87.若客户表customers表中有客户编号cust_id,客户名cust_name,客户地址

cust_email,若要查询和编号10003或10004的客户名相同的客户信息,正确的sql语句为(A) A、select * from customers where cust_name in (select cust_name from customers where cust_id in (10003,10004));

B、Select * from customers where cust_id in (select cust_id from customers where cust_id =10003 and cust_id=10004);

C、Select * from customers where cust_id in (select * from customers where cust_id =10003 and cust_id=10004);

D、select * from customers where cust_id in (select * from customers where cust_id in (10003,10004));

88.当子查询使用来自父查询的参数时,称为(A)。

A、相关子查询B、结果集C、嵌套子查询D、以上都不是

89. 若有客户表customers表,客户表中有cust_id,cust_name,cust_city,有订单表orders,orders表中有列order_num,order_date,cust_id,若要查询每个客户的订单总数,下列语句正确的是( C )

A、select cust_name,cust_city from customers where (select count(*) from orders where customers.cust_id=orders.cust_id); B、select cust_name,cust_city,(select count(*) from orders) as he from customers;

C、select cust_name,cust_city,(select count(*) from orders where customers.cust_id=orders.cust_id) as he from customers;

D、select cust_name,cust_city,(select count(*) from orders where cust_id=cust_id) as he from customers;

90.在带有ANY(SOME)或ALL谓词的子查询中,“查询工资比部门30的任意一个

员工的工资高的姓名、工资、 部门号”,以下sql语句表示正确的是( D ) A、select ename,sal,deptno from emp where salall(select sal from emp where deptno=30); D、select ename,sal,deptno from emp where sal>any(select sal from emp where deptno=30);

91.“查询年龄比部门30的任意一个员工的年龄高的姓名、工资、部门号”,以

下sql语句表示正确的是(A) A、select ename,age,deptno from emp where ageall(select age from emp where deptno=30); D、select ename,age,deptno from emp where age>any(select age from emp where deptno=30);

92.已知关系:学生表stu(学号id,姓名name,籍贯address,年龄age(int类

型),电话tel),若查询比李三年龄小的学生的信息,则正确的sql语句是(C)

A、select * from stu where age>‘李三’;

B、select * from stu where age in (select age from stu where name=‘李三’);

C、select * from stu where age < (select age from stu where name=‘李三’)

D、select * from stu where age >(select age from stu where name=‘李三’);

93.关于exists关键字说法正确的是(A)

A、EXISTS用于检查子查询是否至少会返回一行数据 B、exists可被in子句取代

C、NOT IN 的作用与 EXISTS 的作用一样,可以相互取代 D、以上说法都不正确

94.若想查询emp表中员工scott的上级领导的姓名,正确的是(C )

A、select worker.ename from worker,boss where worker.mgr=boss.empno or worker.ename='scott';

B、select worker.ename from worker,boss where worker.mgr=boss.empno and worker.ename='scott'; C、select boss.ename from worker,boss where worker.mgr=boss.empno and worker.ename='scott';

D、select boss.ename from worker,boss where worker.mgr=boss.empno;

95.有关系学生表s(sno,sname),课程表c(cno,cname),成绩表

sc(sno,cno,grade),若查询每个学生的学号,姓名,选修的课程名和成绩,正确的语句是( B )

A、select s.sno,s.sname,c.cname,sc.grade from c,sc where s.sno=sc.sno; B、select s.sno,s.sname,c.cname,sc.grade

from s, c,sc where s.sno=sc.sno and sc.cno=c.cno; C、select s.sno,s.sname,c.cname,sc.grade

from s,c where s.sno=sc.sno and sc.cno=c.cno;

D、select s.sno,s.sname,c.cname,sc.grade from s,sc where sc.cno=c.cno;

96.已知有表emp(empno,ename,sal,deptno),表dept(deptno,dname,

loc)其中两张表中的deptno都表示部门编号。若要实现连接查询,则查询的字段中表名不可省略的是(C)

A、empno B、ename C、deptno D、dname

97.已知有表emp(empno,ename,job,sal,deptno),其中empno 员工编号,

ename 员工姓名,job 职位,sal工资,deptno部门编号,要查询公司中干同种工作的员工姓名和职位(要求记录不重复),则正确的sql语句是( A )

A、select distinct e1.ename,e1.job from emp e1,emp e2 where e1.job=e2.job and e1.ename!=e2.ename;

B、select distinct ename, job from emp e1,emp e2 where e1.job=e2.job and e1.ename!=e2.ename; C、select distinct ename, job from emp e1,emp e2 where e1.job=e2.job ; D、select e1.ename,e1.job from emp e1,emp e2 where e1.job=e2.job ;

98.有关系学生表s(sno,sname),课程表c(cno,cname),成绩表

sc(sno,cno,grade),若查询学号为1001的学生的姓名,选修的课程名和成绩,正确的语句是(B )

A、select s.sname,c.cname,sc.grade from c,sc

where s.sno=sc.sno and s.sno=1001; B、select sname,c.cname,sc.grade from s, c,sc

where s.sno=sc.sno and sc.cno=c.cno and s.sno=1001; C、select s.sname,c.cname,sc.grade from s,c

where s.sno=sc.sno and sc.cno=c.cno and s.sno=1001; D、select s.sno,s.sname,c.cname,sc.grade from s,sc

where sc.cno=c.cno and s.sno=1001;

99.下列__D___不属于连接种类。

A. 内连接B. 交叉连接C. 左外连接D. 中间连接

100.有三个表,它们的记录行数分别是10行、2行和6行,三个表进行交叉连接

后,结果集中共有___C__行数据。 A. 18 B. 26C. 120 D. 不确定

101.在SQLServer中,有ProInfo(商品信息)表,字段如下:ProID(商品编号)、

ProCatg(商品类别)、ProName(商品名称)、ProPrice(商品价格),下列选项(a)可以查询每一类商品的平均价格.(选择一项)

a) select ProCatg,AVF(ProPrice) from ProInfo group by ProCatg b) select ProCatg.AVG(ProPrice) from ProInfo c) select Avg(ProPrice) from ProInfo

d) select AVG(ProPrice) from ProInfo Order by ProCatg

102. 下列SQL语句,横线处填写(b)可以实现查询年级总人数超过20的年级。

SELECT ______AS 人数,Sgrade AS 年级 FROM students _____Sgrade

_____COUNT(*)>20(选择一项) a.COUNT(*)、GROUP BY、WHERE b.COUNT(*)、ORDER BY、WHERE c.COUNT(*)、ORDER BY、HAVING d.COUNT(*)、GROUP BY、HAVING

103. 在SQLSERVER中,员工表employee包含字段:empId(员工编号),

empName(员工姓名),Salary(工资),deptId(部门编号),要求在员工表中查询至少有10名员工的工资高于5000的部门编号,则一下T-SQL语句正确的是( d ).(选择一项)

a) select deptId,count(*) from employee having salary>5000 group by empId where count(*)>=10

b) select deptId,count(*) from employee where salary>5000 group by empId

having count(*)>=10

c) select deptId,count(*) from employee having salary>5000 group by deptId where count(*)>=10

d) select deptId,count(*) from employee where salary>5000 group by deptId having count(*)>=10

104.关于内连接以下说法正确的是:( B )

A.内连接只能连接2张表

B.关键字inner join的inner 可以省略


数据库复习及联系资料(3).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:三年级部编本 第10课在牛肚子里旅行(优质公开课)

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: