You are on page 1of 6

The ________ operator is used to check whether an attribute has a value.

a. LIKE
25. b. IN
c. BETWEEN
d. EXISTS

The ________ operator is used to find a character string that matches a given string pattern.

a. BETWEEN
26. b. IS NULL
c. IN
d. LIKE

Many queries that would require the use of the logical OR can be more easily handled with the help
of the special operator ________.

27. a. NOT
b. BETWEEN
c. IN
d. LIKE

The ________ command is used to modify the table structure by adding, removing, or renaming
columns.

28. a. ALTER
b. DELETE
c. DROP
d. ERASE

A table can be deleted from the database by using the ________ command.

a. DELETE
29. b. DROP
c. ERASE
d. MODIFY

What is the command used to list the P_CODE, P_DESCRIPT, P_INDATE, and P_PRICE fields from
the PRODUCT table in ascending order by P_PRICE?

SELECT P_CODE, P_DESCRIPT, P_INDATE, P_PRICE


FROM PRODUCT
a. LIST BY P_PRICE;
SELECT P_CODE, P_DESCRIPT, P_INDATE, P_PRICE
FROM PRODUCT
30.
b. ASCENDING BY P_PRICE;
SELECT P_CODE, P_DESCRIPT, P_INDATE, P_PRICE
FROM PRODUCT
c. SEQUENCE BY P_PRICE;
SELECT P_CODE, P_DESCRIPT, P_INDATE, P_PRICE
FROM PRODUCT
d. ORDER BY P_PRICE;
What is the SQL command to output the contents of the Employee table sorted by last name, first
name, and initial?

SELECT EMP_LNAME, EMP_FNAME, EMP_INITIAL, EMP_AREACODE,


EMP_PHONE
FROM EMPLOYEE
a. LIST BY EMP_LNAME, EMP_FNAME, EMP_INITIAL;
SELECT EMP_LNAME, EMP_FNAME, EMP_INITIAL, EMP_AREACODE,
EMP_PHONE
FROM EMPLOYEE
31.
b. DISPLAY BY EMP_LNAME, EMP_FNAME, EMP_INITIAL;
SELECT EMP_LNAME, EMP_FNAME, EMP_INITIAL, EMP_AREACODE,
EMP_PHONE
FROM EMPLOYEE
c. ORDER BY EMP_LNAME, EMP_FNAME, EMP_INITIAL;
SELECT EMP_LNAME, EMP_FNAME, EMP_INITIAL, EMP_AREACODE,
EMP_PHONE
FROM EMPLOYEE
d. SEQUENCE BY EMP_LNAME, EMP_FNAME, EMP_INITIAL;

A multilevel ordered sequence is known as a ________ order sequence.

a. cascading
32. b. 2-tier
c. layered
d. 3-tier

What command is used to list a unique value for Vendor Code (V_CODE), where the list will produce
only a list of those values that are different from one another?

SELECT UNIQUE V_CODE


a. FROM PRODUCT;
SELECT ONLY V_CODE
33.
b. FROM PRODUCT;
SELECT DISTINCT V_CODE
c. FROM PRODUCT;
SELECT DIFFERENT V_CODE
d. FROM PRODUCT;

The basic SQL aggregate function that gives the number of rows containing non-null values for the
given column is ________.

34. a. SUM
b. COUNT
c. MAX
d. MIN

35. The basic SQL aggregate function that gives the total of all values for a selected attribute in a given
column is ________.

a. SUM
b. MAX
c. MIN
d. COUNT

The basic SQL aggregate function that gives the arithmetic mean for the specific column is
________.

36. a. COUNT
b. AVG
c. SUM
d. MAX

The ________ function is used to find the highest value in a table column.

a. TOP
37. b. SUM
c. MAX
d. TOTAL

Frequency distributions can be created quickly and easily using the ________ clause within the
SELECT statement.

38. a. SUM
b. ORDER BY
c. GROUP BY
d. DIST

What is wrong with the following query?


SELECT V_CODE, P_CODE, P_DESCRIPT, P_PRICE
FROM PRODUCT
GROUP BY V_CODE;
39.
a. nothing is wrong
b. no table name is specified
c. no where clause is specified
d. no aggregate function is used

When using GROUP BY, ________ operates like the WHERE clause in the SELECT statement.

a. DISTINCT
40. b. WHERE GROUP
c. LIKE
d. HAVING

A(n) ________ is a virtual table based on a SELECT query.

a. view
41. b. group
c. index
d. aggregate

42. What is the syntax to create a view?


a. NEW VIEW viewname AS SELECT query
b. DECLARE VIEW viewname AS SELECT query
c. CREATE viewname AS SELECT query
d. CREATE VIEW viewname AS SELECT query

The tables on which a view is based are called ________ tables.

a. view
43. b. base
c. aggregate
d. join

What is the command to join the P_DESCRIPT and P_PRICE fields from the PRODUCT table and
the V_NAME, V_AREACODE, V_PHONE and V_CONTACT fields from the VENDOR table where
the values of V_CODE match?

SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT,


V_AREACODE, V_PHONE
FROM PRODUCT, VENDOR
a. WHERE PRODUCT.V_CODE <= VENDOR.V_CODE;
SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT,
V_AREACODE, V_PHONE
44. FROM PRODUCT, VENDOR
b. WHERE PRODUCT.V_CODE => VENDOR.V_CODE;
SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT,
V_AREACODE, V_PHONE
FROM PRODUCT, VENDOR
c. WHERE PRODUCT.V_CODE = VENDOR.V_CODE;
SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT,
V_AREACODE, V_PHONE
FROM PRODUCT, VENDOR
d. WHERE PRODUCT.V_CODE <> VENDOR.V_CODE;

45. What is the command to join the P_DESCRIPT and P_PRICE fields from the PRODUCT table and
the V_NAME, V_AREACODE, V_PHONE and V_CONTACT fields from the VENDOR table where
the values of V_CODE match, and the output is ordered by P_PRICE?

SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT,


V_AREACODE, V_PHONE
FROM PRODUCT, VENDOR
WHERE PRODUCT.V_CODE <> VENDOR.V_CODE;
a. ORDER BY P_PRICE;
SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT,
V_AREACODE, V_PHONE
FROM PRODUCT, VENDOR
WHERE PRODUCT.V_CODE => VENDOR.V_CODE;
b. ORDER BY P_PRICE;
c. SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT,
V_AREACODE, V_PHONE
FROM PRODUCT, VENDOR
WHERE PRODUCT.V_CODE = VENDOR.V_CODE;
ORDER BY P_PRICE;
SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT,
V_AREACODE, V_PHONE
FROM PRODUCT, VENDOR
WHERE PRODUCT.V_CODE <= VENDOR.V_CODE;
d. ORDER BY P_PRICE;

To join tables, you simply list the tables in the ________ clause of the SELECT statement.

a. WHERE
46. b. TABLES
c. JOIN
d. FROM

When must table names be used as a prefix for a column name?

a. when two columns with the same name are specified in the query
47. b. in every query
c. never
d. when more than two tables are used in the query

What is an example of a recursive query?

a.

b.
48.

c.

d.

What is the name for the following query?


SELECT PRODUCT.P_CODE, VENDOR.V_CODE, V_NAME
FROM VENDOR RIGHT JOIN PRODUCT
ON VENDOR.V_CODE = PRODUCT.V_CODE;
49.
a. left outer join
b. view
c. right outer join
d. recursive query

You might also like