Tải bản đầy đủ (.pdf) (6 trang)

Đề thi trắc nghiệm cơ sở dữ liệu trường Cao Thắng- phần 5 ppt

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (254.9 KB, 6 trang )



20. Which of the following statements contains an error?
(a) SELECT * FROM emp WHERE empid = 493945;
(b) SELECT empid FROM emp WHERE empid= 493945;
(c) SELECT empid FROM emp;
(d) SELECT empid WHERE empid = 56949 AND lastname = 'SMITH';
21. Which of the following statements will return the names of
the products with Product ID 10,
11, or 42?
(a) SELECT ProductName FROM products WHERE ProductID IN
(10,11,42)
(b) SELECT ProductName FROM products WHERE ProductID IN 10
OR 11 OR 42
(c) SELECT ProductName FROM products WHERE ProductID =
(10,11,42)
(d) SELECT ProductName FROM products WHERE ProductID IS
(10,11,42)
(e) None of the above
22. Which of the following commands will return the list of
product names sorted in ascending
alphabetic order?
(a) SELECT ProductName FROM products ORDER BY ProductName
DESC
(b) SELECT ProductName FROM products ORDER BY ProductName
ASC
(c) SELECT ProductName FROM products SORTED BY
ProductName ASC
(d) SELECT ProductName FROM products SORTED BY
ProductName DESC
(e) None of the above


23. Which of the following will return a list of every product ID
currently listed in the
order_details table where each product ID is listed only once?
(a) SELECT DISTINCT ProductID FROM order_details
(b) SELECT ProductID FROM order_details ONLY ONCE
(c) SELECT ProductID FROM order_details
(d) SELECT UNIQUE ProductID FROM order_details
(e) None of the above
24. In the instance of the relation R(A,O,T,V,U) shown below,
which of the following functional
dependencies hold ?

25. Which of the following statements contains an error?
(a) SELECT cid, sum (qty) from orders group by cid having
sum(dollars) > 2000;
(b) SELECT aid, avg (qty) from orders group by aid;
(c) SELECT cid, sum (dollars) from orders;
(d) SELECT count (*) from orders;
26. Which code lists employees by descending order of salary
(a) SELECT * FROM EMPLOYEES SORT BY SALARY DESCENDING;
(b) SELECT * FROM EMPLOYEES IN ORDER OF SALARY;
(c) SELECT * FROM EMPLOYEES ORDER BY SALARY DESC;
(d) SELECT * FROM EMPLOYEES ORDER BY SALARY;
27. In order to perform a join, which criteria must be true?
(a) The two tables must have only one column exact same
columns.
(b) The tables in the join need to have common rows.
(c) The two tables must both have primary keys
(d) The two tables must have a common column.
28. Consider the follow attributes and functional dependencies:

A B C
AB→ C
C → A
List all keys (not superkeys):
29. What will result from the following SQL Select statement?
Giáo Trình Cơ Sở Dữ Liệu Trang 101
Biên soạn : Phan Tấn Quốc- Trường Cao Đẳng Kỹ Thuật Cao Thắng
Select min(product_description)
from product_v;
(a) The minimum value of product_description will be displayed.
(b) An error message will be generated.
(c) The first product description alphabetically in product_v will be
shown.
(d) none of the above
30. The following two SQL statements will produce the same
results:
Select last_name, first_name
from customer
where credit_limit > 99 and credit_limit < 10001;
Select last_name, first_name
from customer
where credit_limit between 100 and 10000;
a.TRUE
b.FALSE

×