Question 1
Question
1. The most recent fully approved version of standard SQL prescribed by the ANSI is ____.
Answer
-
a. SQL-99
-
b. SQL-2003
-
c. SQL-4
-
d. SQL-07
Question 2
Question
2. The SQL character data format(s) is(are) ____.
Answer
-
a. CHAR and VARCHAR
-
b. VARCHAR only
-
c. Alphanumeric
-
d. CHAR only
Question 3
Question
3. The SQL command that lets you insert rows into a table is ____.
Answer
-
a. INSERT
-
b. SELECT
-
c. COMMIT
-
d. UPDATE
Question 4
Question
4. The SQL command that lets you permanently save data changes is ____.
Answer
-
a. INSERT
-
b. SELECT
-
c. COMMIT
-
d. UPDATE
Question 5
Question
5. The SQL command that lets you select attributes from rows in one or more tables is ____.
Answer
-
a. INSERT
-
b. SELECT
-
c. COMMIT
-
d. UPDATE
Question 6
Question
6. To list all the contents of the PRODUCT table, you would use ____.
Answer
-
a. LIST * FROM PRODUCT;
-
b. SELECT * FROM PRODUCT;
-
c. DISPLAY * FROM PRODUCT;
-
d. SELECT ALL FROM PRODUCT;
Question 7
Question
7. In Oracle, the ____ command is used to change the display for a column, for example, to place a $ in front of a numeric value.
Answer
-
A) DISPLAY
-
B) FORMAT
-
C) CHAR
-
D) CONVERT
Question 8
Question
8. The SQL command that modifies an attribute’s values in one or more table’s rows is ____.
Answer
-
A) INSERT
-
B) SELECT
-
C) COMMIT
-
D) UPDATE
Question 9
Question
9. UPDATE table name*****[WHERE condition list];The ____ command replaces the ***** in the syntax of the UPDATE command, shown above.
Answer
-
a. SET columnname = expression
-
b. columnname = expression
-
c. expression = columnname
-
d. LET columnname = expression
Question 10
Question
10. An example of a command you would use when making changes to a PRODUCT table is ____.
Answer
-
a. CHANGE PRODUCTSET P_INDATE = '18-JAN-2004'WHERE P_CODE = '13-Q2/P2';
-
b. ROLLBACK PRODUCTSET P_INDATE = '18-JAN-2004'WHERE P_CODE = '13-Q2/P2';
-
c. EDIT PRODUCTSET P_INDATE = '18-JAN-2004'WHERE P_CODE = '13-Q2/P2';
-
d. UPDATE PRODUCTSET P_INDATE = '18-JAN-2004'WHERE P_CODE = '13-Q2/P2';
Question 11
Question
11. The ____ command is used to restore the table’s contents to their previous values.
Answer
-
a. COMMIT; RESTORE;
-
b. COMMIT; BACKUP;
-
c. COMMIT; ROLLBACK;
-
d. ROLLBACK;
Question 12
Question
12. Some RDBMSs, such as Oracle, automatically ____ data changes when issuing data definition commands.
Answer
-
a. COMMIT
-
b. ROLLBACK
-
c. UNSAVE
-
d. UPDATE
Question 13
Question
13. To delete a row from the PRODUCT table, use the ____ command.
Answer
-
a. COMMIT
-
b. DELETE
-
c. ERASE
-
d. KILL
Question 14
Question
14. When you issue the DELETE FROM table name command without specifying a WHERE condition,____.
Answer
-
a. no rows will be deleted
-
b. the first row will be deleted
-
c. the last row will be deleted
-
d. all rows will be deleted
Question 15
Question
15. Which of the following is used to select partial table contents?
Answer
-
a. SELECT <column(s)>FROM <Table name>BY <Conditions>;
-
b. LIST <column(s)>FROM <Table name>BY <Conditions>;
-
c. SELECT <column(s)>FROM <Table name>WHERE <Conditions>;
-
d. LIST<column(s)>FROM <Table name>WHERE <Conditions>;
Question 16
Question
16. The ____ command would be used to delete the table row where the P_CODE is 'BRT-345'.
Answer
-
a. DELETE FROM PRODUCTWHERE P_CODE = 'BRT-345';
-
b. REMOVE FROM PRODUCTWHERE P_CODE = 'BRT-345';
-
c. ERASE FROM PRODUCTWHERE P_CODE = 'BRT-345';
-
d. ROLLBACK FROM PRODUCTWHERE P_CODE = 'BRT-345';
Question 17
Question
17. A(n) ____ is a query that is embedded (or nested) inside another query.
Answer
-
a. alias
-
b. operator
-
c. subquery
-
d. view
Question 18
Question
18. Which query will output the table contents when the value of V_CODE is equal to 21344?
Answer
-
a. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODEFROM PRODUCTWHERE V_CODE <> 21344;
-
b. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODEFROM PRODUCTWHERE V_CODE <= 21344;
-
c. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODEFROM PRODUCTWHERE V_CODE = 21344;
-
d. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODEFROM PRODUCTWHERE V_CODE => 21344;
Question 19
Question
19. Which query will output the table contents when the value of V_CODE is not equal to 21344?
Answer
-
a. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODEFROM PRODUCTWHERE V_CODE <> 21344;
-
b. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODEFROM PRODUCTWHERE V_CODE <= 21344;
-
c. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODEFROM PRODUCTWHERE V_CODE = 21344;
-
d. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODEFROM PRODUCTWHERE V_CODE => 21344;
Question 20
Question
20. Which query will output the table contents when the value of P_PRICE is less than or equal to 10?
Answer
-
a. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODEFROM PRODUCTWHERE P_PRICE <> 10;
-
b. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODEFROM PRODUCTWHERE P_PRICE <= 10;
-
c. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODEFROM PRODUCTWHERE P_PRICE => 10;
-
d. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODEFROM PRODUCTWHERE P_PRICE = 10;
Question 21
Question
21. Which query will output the table contents when the value of the character field P_CODE is alphabetically less than 1558-QW1?
Answer
-
a. SELECT P_CODE, P_DESCRIPT, P_QOH, P_MIN, P_PRICEFROM PRODUCT WHERE P_CODE <'1558-QW1';
-
b. SELECT P_CODE, P_DESCRIPT, P_QOH, P_MIN, P_PRICEFROM PRODUCTWHERE P_CODE = [1558-QW1]
-
c. SELECT P_CODE, P_DESCRIPT, P_QOH, P_MIN, P_PRICEFROM PRODUCTWHERE P_CODE = (1558-QW1)
-
d. SELECT P_CODE, P_DESCRIPT, P_QOH, P_MIN, P_PRICEFROM PRODUCTWHERE P_CODE = {1558-QW1}
Question 22
Question
22. Which query will list all the rows in which the inventory stock dates occur on or after January 20, 2010?
Answer
-
a. SELECT P_DESCRIPT, P_QOH, P_MIN, P_PRICE, P_INDATEFROM PRODUCTWHERE P_INDATE >= '20-JAN-2010'
-
b. SELECT P_DESCRIPT, P_QOH, P_MIN, P_PRICE, P_INDATEFROM PRODUCTWHERE P_INDATE >= $20-JAN-2010$
-
c. SELECT P_DESCRIPT, P_QOH, P_MIN, P_PRICE, P_INDATEFROM PRODUCTWHERE P_INDATE <= '20-JAN-2010'
-
d. SELECT P_DESCRIPT, P_QOH, P_MIN, P_PRICE, P_INDATEFROM PRODUCTWHERE P_INDATE >= {20-JAN-2010}
Question 23
Question
23. Which query will use the given columns and column aliases from the PRODUCT table to determine the total value of inventory held on hand?
Answer
-
a. SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH/P_PRICEFROM PRODUCT;
-
b. SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH=P_PRICEFROM PRODUCT;
-
c. SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH*P_PRICEFROM PRODUCT;
-
d. SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH-P_PRICEFROM PRODUCT;
Question 24
Question
24. A(n) ____ is an alternate name given to a column or table in any SQL statement.
Answer
-
a. alias
-
b. data type
-
c. stored function
-
d. Trigger
Question 25
Question
25. Which query will use the given columns and column aliases from the PRODUCT table to determine the total value of inventory held on hand and display the results in a column labeled TOTVALUE?
Answer
-
a. SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH*P_PRICE AS TOTVALUEFROM PRODUCT;
-
b. SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH=P_PRICE AS TOTVALUEFROM PRODUCT;
-
c. SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH/P_PRICE AS TOTVALUEFROM PRODUCT;
-
d. SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH-P_PRICE AS TOTVALUEFROM PRODUCT;
Question 26
Question
26. Which query uses the correct SQL syntax to list the table contents for either V_CODE = 21344 or V_CODE = 24288?
Answer
-
a. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODEFROM PRODUCTWHERE V_CODE = 21344OR
V_CODE <= 24288
-
b. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODEFROM PRODUCTWHERE V_CODE = 21344OR
V_CODE => 24288
-
c. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODEFROM PRODUCTWHERE V_CODE = 21344OR
V_CODE > 24288
-
d. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODEFROM PRODUCTWHERE V_CODE = 21344OR
V_CODE = 24288
Question 27
Question
27. The special operator used to check whether an attribute value is within a range of values is ____.
Answer
-
a. BETWEEN
-
b. NULL
-
c. LIKE
-
d. IN
Question 28
Question
28. The ____ special operator is used to check whether an attribute value is null.
Answer
-
a. BETWEEN
-
b. IS NULL
-
c. LIKE
-
d. IN
Question 29
Question
29. The special operator used to check for similar character strings is ____.
Answer
-
a. BETWEEN
-
b. IS NULL
-
c. LIKE
-
d. IN
Question 30
Question
30. The special operator used to check whether a subquery returns any rows is ____.
Answer
-
a. BETWEEN
-
b. EXISTS
-
c. LIKE
-
d. IN
Question 31
Question
31. The ____ command is used with the ALTER TABLE command to modify the table by deleting a column.
Answer
-
a. DROP
-
b. REMOVE
-
c. DELETE
-
d. ERASE
Question 32
Question
32. A table can be deleted from the database by using the ____ command.
Answer
-
a. DROP TABLE
-
b. DELETE TABLE
-
c. MODIFY TABLE
-
d. ERASE TABLE
Question 33
Question
33. The query used to list the P_CODE, P_DESCRIPT, P_INDATE, and P_PRICE fields from the PRODUCT table in ascending order by P_PRICE is ____.
Answer
-
a. SELECT P_CODE, P_DESCRIPT, P_INDATE, P_PRICEFROM PRODUCTSEQUENCE BY P_PRICE;
-
b. SELECT P_CODE, P_DESCRIPT, P_INDATE, P_PRICEFROM PRODUCTLIST BY P_PRICE;
-
c. SELECT P_CODE, P_DESCRIPT, P_INDATE, P_PRICEFROM PRODUCTORDER BY P_PRICE;
-
d. SELECT P_CODE, P_DESCRIPT, P_INDATE, P_PRICEFROM PRODUCTASCENDING BY P_PRICE;
Question 34
Question
34. The SQL query to output the contents of the EMPLOYEE table sorted by last name, first name, and initial is ____.
Answer
-
a. SELECT EMP_LNAME, EMP_FNAME, EMP_INITIAL, EMP_AREACODE,EMP_PHONEFROM
EMPLOYEELIST BY EMP_LNAME, EMP_FNAME, EMP_INITIAL;
-
b. SELECT EMP_LNAME, EMP_FNAME, EMP_INITIAL, EMP_AREACODE,EMP_PHONEFROM
EMPLOYEEORDER BY EMP_LNAME, EMP_FNAME, EMP_INITIAL;
-
c. SELECT EMP_LNAME, EMP_FNAME, EMP_INITIAL, EMP_AREACODE,EMP_PHONEFROM
EMPLOYEEDISPLAY BY EMP_LNAME, EMP_FNAME, EMP_INITIAL;
-
d. SELECT EMP_LNAME, EMP_FNAME, EMP_INITIAL, EMP_AREACODE,EMP_PHONEFROM
EMPLOYEESEQUENCE BY EMP_LNAME, EMP_FNAME, EMP_INITIAL;
Question 35
Question
35. Which query is used to list a unique value for V_CODE, where the list will produce only a list of those values that are different from one another?
Answer
-
a. SELECT ONLY V_CODEFROM PRODUCT;
-
b. SELECT UNIQUE V_CODEFROM PRODUCT
-
c. SELECT DIFFERENT V_CODEFROM PRODUCT
-
d. SELECT DISTINCT V_CODEFROM PRODUCT;
Question 36
Question
36. The SQL aggregate function that gives the number of rows containing non-null values for the given column is ____.
Answer
-
a. COUNT
-
b. MIN
-
c. MAX
-
d. SUM
Question 37
Question
37. The SQL aggregate function that gives the total of all values for a selected attribute in a given column is ____.
Answer
-
a. COUNT
-
b. MIN
-
c. MAX
-
d. SUM
Question 38
Question
38. The SQL aggregate function that gives the average for the specific column is ____.
Answer
-
a. COUNT
-
b. AVG
-
c. MAX
-
d. SUM
Question 39
Question
39. The query 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 is ____.
Answer
-
a. SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT, V_AREACODE,V_PHONEFROM PRODUCT,
VENDORWHERE PRODUCT.V_CODE <> VENDOR.V_CODE;
-
b. SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT, V_AREACODE,V_PHONEFROM PRODUCT,
VENDORWHERE PRODUCT.V_CODE = VENDOR.V_CODE;
-
c. SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT, V_AREACODE,V_PHONEFROM PRODUCT,
VENDORWHERE PRODUCT.V_CODE <= VENDOR.V_CODE;
-
d. SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT, V_AREACODE,V_PHONEFROM PRODUCT,
VENDORWHERE PRODUCT.V_CODE => VENDOR.V_CODE;
Question 40
Question
40. The query 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 the price is ____.
Answer
-
a. SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT, V_AREACODE,V_PHONEFROM PRODUCT,
VENDORWHERE PRODUCT.V_CODE <> VENDOR.V_CODE;ORDER BY P_PRICE;
-
b. SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT, V_AREACODE,V_PHONEFROM PRODUCT,
VENDORWHERE PRODUCT.V_CODE => VENDOR.V_CODE;ORDER BY P_PRICE;
-
c. SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT, V_AREACODE,V_PHONEFROM PRODUCT,
VENDORWHERE PRODUCT.V_CODE <= VENDOR.V_CODE;ORDER BY P_PRICE;
-
d. SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT, V_AREACODE,V_PHONEFROM PRODUCT,
VENDORWHERE PRODUCT.V_CODE = VENDOR.V_CODE;ORDER BY P_PRICE;