数据库单世民 课堂问卷题目

1.
Which one is ‘bigger’ ?
database
database system
database management system
database operating system
2.
Which problems are not focused by database system, with respect to file-processing system?[多选题]
Data redundancy and inconsistency
Atomicity of updates
Concurrent access by multiple users
Security problems
Difficulty in accessing data
Data isolation
Integrity problems
data analytic processing
3.
How many abstraction layers are used in architectures of classical DBMS products?
2
3
4
5
4.
What is analogous to data type, schema or instance?
Schema
Instance
5.
Which kind of data model is relational model belongs to?
Conceptual model
Logical model
Physical model
6.
In relational model, relation is collection of ( )?
cells
columns
rows
tuples
7.
Which can be analogous to variable?
relation
relation schema
relation instance
relationship
8.
Null is a value and can be compared by using logical equal operation, is it correct?
correct
wrong
9.
Every relation has at least one superkey, is it correct?
correct
wrong
10.
Which is more useful, superkey or candidate key?
superkey
candidate key
11.
Foreign key can be used to uniquely identify tuples, is it correct?
correct
wrong
12.
Which commands operate the same kind of objects as the command ‘alter’?[多选题]
insert
drop
delete
creat
select
create
update
13.
Which commands operate the same kind of objects as the command ‘update’?[多选题]
insert
drop
delete
creat
select
create
alter
14.
The kind of objects operated with command ‘select’ is ()
attributes
attribute values of tuples
tuples
relation
relation instance
15.
Given tables r(m rows) and s(n rows),then how many rows should be contained in the result of command ‘select 1 from r,s’?
m
n
m*n
m+n
r
s
r*s
1
16.
Given tables r(m columns) and s(n columns),then how many columns should be contained in the result of command ‘select * from r,s’?
m
n
m*n
m+n
r
s
r*s
none of above
17.
The clause “order by deptno,sal desc, ename” means:
First, sort by deptno descend; then, sort by sal descend; then, sort by ename descend
First, sort by deptno ascend; then, sort by sal descend; then, sort by ename ascend
First, sort by deptno ascend; then, sort by sal descend; then, sort by ename descend
First, sort by ename descend; then, sort by sal descend; then, sort by deptno descend
18.
The result of command “select * from r join s” on MS SQLServer is:
Error for the reason of invalid syntax
Cartesian product of relation r and s
Natural join of relation r and s
All rows in r and s
19.
The order of conceptual operation of command “select * from r where r.b=v order by b” is:
Select->from->where->order by
from->where->order by->select
where->from->select->order by
from->where->select->order by
20.
The kind of objects operated with DML commands is ()
attributes
attribute values of tuples
tuples
relation
relation instance
21.
The result of command “select * from r where 1=1 and c>5” is:
All rows in r
All rows whose first attribute are 1 and attribute c are greater than 5
All rows whose attribute c are greater than 5
No rows will be there
22.
How to find name of direct manager of 'scott':[多选题]
select a.ename from emp self join emp as a where a.ename='scott'
select a.ename from emp natural join emp as a where a.ename='scott'
select ename from emp as a join emp on a.empno=emp.empno where a.ename='scott'
select a.ename from emp as a,emp as b where a.mgr=b.empno where a.ename='scott'
select a.ename from emp as a,emp as b where a.empno=b.mgr where b.ename='scott'
select a.ename from emp as a join emp as b on a.empno=b.mgr where b.ename='scott'
23.
How to find the department which have at least 3 employee:[多选题]
select dname from emp join dept on dept.deptno=emp.deptno group by emp.deptno having count(*)>2
select dname from emp join dept on dept.deptno=emp.deptno group by dept.deptno,dname having count(*)>2
select dname from emp join dept on dept.deptno=emp.deptno group by emp.deptno,dname having min(count(*))=3
select dname from emp join dept on dept.deptno=emp.deptno group by dept.deptno,dname having min(count(*))>2
select dname from emp,dept where dept.deptno=emp.deptno group by dname having count(*)>2
select dname from emp join dept on dept.deptno=emp.deptno group by dname where count(*)>2
select dname from emp join dept on dept.deptno=emp.deptno where count(*)>=2 group by dname
24.
The result of command "select empno,(select avg(sal) from emp group by deptno) from emp" is:
Every employee's empno and his/her department's average salary.
Every employee's empno and average salary of all the employee.
Every employee's empno and all the average salary of all the departments.
None of above
25.
The result of command "select empno,ename from emp where deptno = (select deptno from emp where sal>2000)" is:
Information of workers who worked in departments which pay some employees more than 2000 dollars
Information of workers who worked in departments in which the minimum salary is more than 2000 dollars
Information of workers who worked in departments which pay some employees more than 2000 dollars
None of above
26.
The result of command "select empno,ename,(select max(sal) from emp as a where deptno=emp.deptno) from emp" is:
Every employee's empno and his/her department's maximum salary.
Every employee's empno and average salary of all the employee.
Every employee's empno and all the average salary of all the departments.
None of above
27.
The result of command "select empno,ename from emp where deptno<> any (select deptno from emp group by deptno having avg(sal)>2000)" is (assume there are two department have the average sal more than 2000 dollar):
Information of all employees who worked in department whose average salary is more than 2000 dollars.
Information of all employees who don't worked in department whose average salary is more than 2000 dollars.
Information of all employees
None of above
28.
The subquery in command "select empno,ename from emp where exists(select 100 from emp as b where b.job=emp.job and b.deptno=emp.deptno and b.empno<>emp.empno)" :
is a correlated subquery
is not a correlated subquery
can be a correlated subquery sometime, can also not be a correlated subquery in other time.
29.
The subquery in command "select empno,ename from emp where deptno = (select deptno from emp where sal>2000)":
is a correlated subquery
is not a correlated subquery
can be a correlated subquery sometime, can also not be a correlated subquery in other time.
30.
The subquery in command "select empno,ename from emp where exists(select 100 from emp)" :
is a correlated subquery
is not a correlated subquery
can be a correlated subquery sometime, can also not be a correlated subquery in other time.
31.
The subquery in command "select empno,ename from (select * from emp where sal>2000)" :
is a correlated subquery
is not a correlated subquery
can be a correlated subquery sometime, can also not be a correlated subquery in other time.
32.
The subquery in command "select dname,(select count(*) from emp where emp.deptno=dept.deptno) from dept" :
is a correlated subquery
is not a correlated subquery

can be a correlated subquery sometime, can also not be a correlated subquery in other time.


relation只是元组的集合   关系  相当于变量variable
relation instace类比value
Schemal类比数据类型   变量的一列  data type

关系模型:结构 操作 完整性约束
概念模型:对现实世界认知  用图示方式表示出来  er模型   
物理模型:图  二叉树

关系是元组的集合   元组与属性   行和列

alter  dop   create   ddl语句
insert  select  update  delete     dml命令 代表关系relation

from   where   select order by

注意标量子查询   说明select 里面必须是 标量值   一行里面的属性值  不可以出现表中表的现象

猜你喜欢

转载自blog.csdn.net/idiot2B/article/details/80551308