Machine-translated by Google. Questions are authored in English.
Top

SQL for Database Construction Questions and Answers

21.

When a foreign key column is created without a corresponding foreign key constraint, we have created a "casual relationship" between the two tables.

Answer: A

Correct answer: True

A casual relationship is one implied by the data but not declared to the DBMS: the foreign key column is present and the application relies on it, but no constraint enforces the reference. Nothing then prevents an orphaned value, and the integrity depends entirely on every program getting it right.

Please log in or register to report this question.

22.

The SQL command to create a table is:

Answer: D

Correct answer: CREATE TABLE.

CREATE TABLE defines the table, its columns, their data types and null status, and the constraints on them. ALTER TABLE changes a table that already exists, and the other two are not SQL statements at all - a reminder that the data definition verbs are few and fixed: CREATE, ALTER and DROP.

Please log in or register to report this question.

23.

What is not an advantage of stored procedures?

Answer: D

Correct answer: Increased network traffic

Stored procedures reduce network traffic, since only the call and its parameters cross the network instead of the statements and their intermediate results. The other three are genuine advantages: permissions can be granted on the procedure rather than the tables, the plan is compiled and reused, and the code is written once and shared.

Please log in or register to report this question.

24.

A SQL view is a virtual table that is constructed from other tables or views.

Answer: A

Correct answer: True

A view is virtual because nothing is stored but its defining query; the rows are produced each time it is read. It may be built from tables or from other views, which allows layers of abstraction, and it behaves like a table in a query while carrying none of a table’s storage.

Please log in or register to report this question.

25.

There are three SQL data modification operations: insert, modify and delete.

Answer: A

Correct answer: True

INSERT, UPDATE and DELETE are the three data manipulation operations that change stored data, and every modification a program makes is one of them. They are distinct from the data definition statements, which change structure rather than content.

Please log in or register to report this question.

26.

The SQL MAKE TABLE command is used to construct tables, define columns, define column constraints and create relationships.

Answer: B

Correct answer: False

There is no MAKE TABLE statement in SQL. The verb is CREATE TABLE, and it does everything the statement describes - defines columns and their constraints and, through foreign key declarations, the relationships between tables.

Please log in or register to report this question.

27.

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

Answer: A

Correct answer: True

That is the definition, and the two halves are both essential: the procedure performs an action on the data, and it lives in the database rather than in the application. From that follow its advantages - one copy to maintain, a compiled plan to reuse, permissions granted on the procedure, and little traffic across the network.

Please log in or register to report this question.

28.

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

Answer: B

Correct answer: A view

A view is virtual: nothing is stored but the SELECT that defines it, and the rows are produced when it is queried. That is what makes it always current and what distinguishes it from a table, which holds data, and from query results, which are a one-off answer rather than a named object.

Please log in or register to report this question.

29.

The SQL DELETE statement is used to delete both the table structure and table data.

Answer: B

Correct answer: False

DELETE removes rows and leaves the table, its definition, its indexes and its constraints in place; an empty table remains. Removing the structure as well is DROP TABLE. The distinction is worth being certain of, since the two mistakes are not equally recoverable.

Please log in or register to report this question.

30.

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

Answer: D

Correct answer: All of the above.

Oracle supports BEFORE, AFTER and INSTEAD OF triggers. The BEFORE trigger is the one that distinguishes it from SQL Server, which has only the other two, and it is convenient for validating or altering values before they are written.

Please log in or register to report this question.

Loading…

Other Subjects

Tags: SQL for Database Construction Questions and Answers || SQL for Database Construction MCQ Questions and Answers || SQL for Database Construction GK Questions and Answers || SQL for Database Construction GK MCQ Questions || SQL for Database Construction Multiple Choice Questions and Answers || SQL for Database Construction GK || GK on SQL for Database Construction || Database Questions and Answers || Database MCQ Questions and Answers || Database GK Questions and Answers || GK on Database