Database

Database

SQL for Database Construction has 39 Questions

The SQL command to create a table is:

MAKE TABLE.
ALTER TABLE.
DEFINE TABLE.
CREATE TABLE.
The SQL statement used to create a view is CREATE VIEW.

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

pseudofile
embedded SELECT statement
trigger
None of the above is correct.
The SQL MAKE TABLE command is used to construct tables, define columns, define column constraints and create relationships.

True
False
The DROP TABLE statement:

deletes the table structure only.
deletes the table structure along with the table data.
works whether or not referential integrity constraints would be violated.
is not an SQL statement.
SQL has a JOIN ON syntax that can be used to create inner joins and outer joins.

True
False
SQL views can be used to hide:

columns and rows only.
complicated SQL syntax only.
both of the above can be hidden by an SQL view.
None of the above is correct.
Standard SQL-92 views are constructed from SQL SELECT statements that do not contain the GROUP BY clause.

True
False
The SQL statement to create a view is:

CREATE VIEW.
MAKE VIEW.
SELECT VIEW.
INSERT VIEW.
The SQL CHECK constraint is fully defined by the SQL-92 standard, and is consistently implemented by all DBMS vendors.

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

a particular column in a particular underlying table.
a particular column in a particular row.
a particular row in a particular underlying table.
None of the above is correct.
SQL Server does not support the BEFORE trigger.

True
False
Which of the following is NOT a type of SQL constraint?

PRIMARY KEY
FOREIGN KEY
ALTERNATE KEY
UNIQUE
A updatable view has its own data.

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

trigger
stored procedure
pseudofile
None of the above is correct.
The SQL DELETE statement is used to delete both the table structure and table data.

True
False
For what purposes are views used?

To hide columns only
To hide rows only
To hide complicated SQL statements only
All of the above are uses for SQL views.
Common types of SQL CHECK constraints include range checks and limiting columns values.

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

Just another table
A view
A relation
Query results
If any required (NOT NULL) columns are missing from the view, the view cannot be used for inserting new data.

True
False
When using the SQL INSERT statement:

rows can be modified according to criteria only.
rows cannot be copied in mass from one table to another only.
rows can be inserted into a table only one at a time only.
rows can either be inserted into a table one at a time or in groups.
When a foreign key column is created without a corresponding foreign key constraint, we have created a "casual relationship" between the two tables.

True
False
What is not an advantage of stored procedures?

Greater security
SQL can be optimized
Code sharing
Increased network traffic
Views can be used to show the results of computed columns.

True
False
A reason for using an SQL view to hide columns is:

to simplify a result only.
to prevent the display of sensitive data only.
to accomplish both of the above.
None of the above are reasons for using an SQL view.
A benefit of using a stored procedure is that it can be distributed to client computers.

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

BEFORE
INSTEAD OF
AFTER
All of the above.
A trigger is a stored program that is attached to a database.

True
False
The SQL ALTER statement can be used to:

change the table structure.
change the table data.
add rows to the table.
delete rows from the table.
A stored procedure is a program that performs some common action on database data and is stored in the database.

True
False
What SQL structure is used to limit column values of a table?

The LIMIT constraint
The CHECK constraint
The VALUE constraint
None of the above is correct.
A SQL view is a virtual table that is constructed from other tables or views.

True
False
Which is NOT one of the most common types of SQL CHECK constraints?

System date
Range checks
Lists of values
Comparing one column value to another within the same table
There are three SQL data modification operations: insert, modify and delete.

True
False
What is an advantage of placing computations in SQL views?

To save users from having to write an expression.
To ensure that the results are consistent.
To accomplish both of the above.
None of the above is correct - computations cannot be placed in a view.
SQL statements can be embedded in triggers, stored procedures, and program code.

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

GROUP BY.
WHERE.
ORDER BY.
FROM.
A view that contains a computed column can be easily updated.

True
False
Three types of triggers are: BEFORE, AFTER and EXCEPTION.

True
False