Database - SQL for Database Construction MCQs Part

1. The SQL command to create a table is:

A.
MAKE TABLE.
B.
ALTER TABLE.
C.
DEFINE TABLE.
D.
CREATE TABLE.

 Answer Option D

2. A ________ is a stored program that is attached to a table or a view.

A.
pseudofile
B.
embedded SELECT statement
C.
trigger
D.
None of the above is correct.

 Answer Option C

3. The DROP TABLE statement:

A.
deletes the table structure only.
B.
deletes the table structure along with the table data.
C.
works whether or not referential integrity constraints would be violated.
D.
is not an SQL statement.

 Answer Option B

4. SQL views can be used to hide:

A.
columns and rows only.
B.
complicated SQL syntax only.
C.
both of the above can be hidden by an SQL view.
D.
None of the above is correct.

 Answer Option C

5. The SQL statement to create a view is:

A.
CREATE VIEW.
B.
MAKE VIEW.
C.
SELECT VIEW.
D.
INSERT VIEW.

 Answer Option A

6. To update an SQL view, the DBMS must be able to associate the column(s) to be updated with:

A. a particular column in a particular underlying table.
B. a particular column in a particular row.
C. a particular row in a particular underlying table.
D. None of the above is correct.

 Answer Option C

7. Which of the following is NOT a type of SQL constraint?

A. PRIMARY KEY
B. FOREIGN KEY
C. ALTERNATE KEY
D. UNIQUE

 Answer Option C

8. A ________ is a program that performs some common action on database data and that is stored in the database.

A. trigger
B. stored procedure
C. pseudofile
D. None of the above is correct.

 Answer Option B

9. For what purposes are views used?

A. To hide columns only
B. To hide rows only
C. To hide complicated SQL statements only
D. All of the above are uses for SQL views.

 Answer Option D

10. What is an SQL virtual table that is constructed from other tables?

A. Just another table
B. A view
C. A relation
D. Query results

 Answer Option B

11. When using the SQL INSERT statement:

A. rows can be modified according to criteria only.
B. rows cannot be copied in mass from one table to another only.
C. rows can be inserted into a table only one at a time only.
D. rows can either be inserted into a table one at a time or in groups.

 Answer Option D

12. What is not an advantage of stored procedures?

A. Greater security
B. SQL can be optimized
C. Code sharing
D. Increased network traffic

 Answer Option D

13. A reason for using an SQL view to hide columns is:

A. to simplify a result only.
B. to prevent the display of sensitive data only.
C. to accomplish both of the above.
D. None of the above are reasons for using an SQL view.

 Answer Option C

14. Which of the following is an SQL trigger supported by Oracle?

A. BEFORE
B. INSTEAD OF
C. AFTER
D. All of the above.

 Answer Option D

15. The SQL ALTER statement can be used to:

A. change the table structure.
B. change the table data.
C. add rows to the table.
D. delete rows from the table.

 Answer Option A

16. What SQL structure is used to limit column values of a table?

A. The LIMIT constraint
B. The CHECK constraint
C. The VALUE constraint
D. None of the above is correct.

 Answer Option B

17. Which is NOT one of the most common types of SQL CHECK constraints?

A. System date
B. Range checks
C. Lists of values
D. Comparing one column value to another within the same table

 Answer Option A

18. What is an advantage of placing computations in SQL views?

A. To save users from having to write an expression.
B. To ensure that the results are consistent.
C. To accomplish both of the above.
D. None of the above is correct - computations cannot be placed in a view.

 Answer Option C

19. Views constructed from SQL SELECT statements that conform to the SQL-92 standard may not contain:

A. GROUP BY.
B. WHERE.
C. ORDER BY.
D. FROM.

 Answer Option C

6. To update an SQL view, the DBMS must be able to associate the column(s) to be updated with:

A. a particular column in a particular underlying table.
B. a particular column in a particular row.
C. a particular row in a particular underlying table.
D. None of the above is correct.

 Answer Option C

7. Which of the following is NOT a type of SQL constraint?

A. PRIMARY KEY
B. FOREIGN KEY
C. ALTERNATE KEY
D. UNIQUE

 Answer Option C

8. A ________ is a program that performs some common action on database data and that is stored in the database.

A. trigger
B. stored procedure
C. pseudofile
D. None of the above is correct.

 Answer Option B

9. For what purposes are views used?

A. To hide columns only
B. To hide rows only
C. To hide complicated SQL statements only
D. All of the above are uses for SQL views.

 Answer Option D

10. What is an SQL virtual table that is constructed from other tables?

A. Just another table
B. A view
C. A relation
D. Query results

 Answer Option B

Comments

Most Popular

Remove Unicode Zero Width Space PHP

PhpStorm, return value is expected to be 'A', 'object' returned

Laravel file upload returns forbidden 403, file permission is 700 not 755