SQL Test With Answers
SQL Test With Answers
EXAM TESTING
QUESTION 1
Answers: A, B
QUESTION 2
The TO_NUMBER function converts either character strings or date values to a number in the format
specified by the optional format model.
A. True
B. False
Answers: B
QUESTION 3
Answer: C
QUESTION 4
The following statements produce the same results:
DELETE FROM copy_emp;
TRUNCATE TABLE copy_emp;
A. True
B. False
Answers: B
QUESTION 5
A. COMMIT
B. SELECT
C. CREATE
D. ROLLBACK
E. SAVEPOINT
Answers: B,E
QUESTION 6
Which of the following are NOT valid operators for the WHERE clause?
A. >=
B. IS NULL
C. !=
D. IS LIKE
E. IN BETWEEN
F. <>
Answers: D, E
QUESTION 7
Indexes must be created manually and serve to speed up access to rows in a table.
A. True
B. False
Answers: B
QUESTION 8
Which statements is not true regarding the COALESCE function? (choose all that apply)
Answers: A, B, D
QUESTION 9
Answers: A, C
QUESTION 10
When you use the INSERT or UPDATE command, the DEFAULT keyword saves you from hard-coding
the default value in your programs or querying the dictionary to find it.
A. True
B. False
Answer: A
QUESTION 11
Which two statements are not true regarding the USING clause in table joins? (Choose two .)
Answers: A, C
QUESTION 12
Answer: A
QUESTION 13
Answer: C,D
QUESTION 14
Answer: A
QUESTION 15
Which statements are not true regarding subqueries? (Choose all that apply)
Answers: B, C, E
QUESTION 16
The dictionary views that are based on the dictionary tables contain information such as:
A. Definitions of all the schema objects in the database
B. Default values for the columns
C. Integrity constraint information
D. Privileges and roles that each user has been granted
E. All of the above
Answer: E
QUESTION 17
A. Enforce rules on the data in a table whenever a row is inserted, updated, or deleted.
B. Prevent the deletion of a table.
C. Prevent the creation of a table.
D. Prevent the creation of data in a table.
Answer: A, B, D
QUESTION 18
A. After a user creates an object, the user can pass along any of the available object privileges to
other users by using the GRANT statement.
B. A user can create roles by using the CREATE ROLE statement to pass along a collection of
system or object privileges to other users.
C. Users can change their own passwords.
D. Users can view the privileges granted to them and those that are granted on their objects.
Answers: A, C, D
QUESTION 19
Which statement is true regarding the above query if the subquery returns no rows?
A. It produces an error.
B. It executes and returns all rows of customers table.
C. It executes but returns no rows.
Answers: B
QUESTION 20
Which ORDER BY clauses are not valid for the above query? (Choose all that apply.)
A. ORDER BY 2,1
B. ORDER BY CUST_NO
C. ORDER BY 2,cust_id
D. ORDER BY "CUST_NO"
E. ORDER BY "Last Name"
Answers: B, D