10. The ____ set operator will show all rows common to both
tables A and B.
(a) intersection
(b) union
(c) difference
(d) product
11. Using the product operator, if table A has 2 rows and table B
has 4 rows, the number of
rows in the product of these two tables is:
(a) 4.
(b) 8.
(c) 16.
(d) 20.
12. Suppose relation R(A,B,C,D,E) has the following functional
dependencies:
A → B
B → C
BC → A
A → D
D → E
Which of the following is not a key?
(a) A
(b) E
(c) B
(d) D
(e) (b) and (d)
13. Consider a relation Q with five attributes L V O B Y. You are
given the follwoing
dependencies: L → V; VO → Y and YB → L.
The number of superkeys of Q is: (not superkeys)
(a).2
(b).3
(c),4
(d).5
Giáo Trình Cơ Sở Dữ Liệu Trang 97
Biên soạn : Phan Tấn Quốc- Trường Cao Đẳng Kỹ Thuật Cao Thắng
14. Use the following tables and data,All of the fields are
Integers.The table names are Q
A B C D
1 2 3 4
1 3 5 7
2 3 4 5
2 4 6 8
5 6 7 8
How many records does the following SQL example return?
SELECT * FROM Q WHERE A>=5 OR D>=7;
a) 1
b) 2
c) 3
d) 4
15. How many records does the following SQL example return?
SELECT sum(A) AS S FROM Q GROUP BY A;
16. The SQL below will return one value. What is it?
17. How many records does the following SQL example return?
SELECT count(*) FROM Q GROUP BY A, B;
a) 2
b) 3
c) 4
d) 6
e) None of the above
18. Use the following tables and data All of the fields are
Integers.The table names are R and
How many records does the following SQL example return?
SELECT COUNT(*) FROM R, S WHERE R.A=S.D OR R.B=S.E;
a) 1
b) 2
c) 3
d) 4
19. How many records does the following SQL example return?
SELECT COUNT(*) FROM R, S WHERE R.A=S.D;
a) 0
b) 1
c) 2
d) 4