Database Lab_Ch4_Quiz
Only one ____ constraint can exist for each table.
PRIMARY
Which of the following types of constraints will not allow NULL values?
PRIMARY KEY
In the USER_CONSTRAINTS view, the value displayed in the CONSTRAINT_TYPE column will be a(n) ____ for a FOREIGN KEY constraint.
R
Which of the following is not a constraint type in Oracle 12c ?
REFERENCE
The purpose of the ____ constraint is to ensure that two records do not have the same value stored in the same column. However, it can contain NULL values.
UNIQUE
If the ____ keyword is included when a constraint is created, a constraint name must be provided by the user
constraint
Which of the following are used to enforce business rules?
constraints
When used with a FOREIGN KEY, the keyword REFERENCES refers to what?
reference integrity
Based on the structure of the ORDERITEMS table, which of the following commands will make certain that the ISBN entered actually exists in the ISBN column of the BOOKS table?
ALTER TABLE orderitems ADD FOREIGN KEY (isbn) REFERENCES books(isbn);
If a PRIMARY KEY constraint, named ORDERITEMS_PK, exists for the ORDER# and ITEM# columns of the ORDERITEMS table, which of the following commands will disable the constraint?
ALTER TABLE orderitems DISABLE CONSTRAINT orderitems_pk
If a PRIMARY KEY constraint, named ORDERITEMS_PK, exists for the ORDER# and ITEM# columns of the ORDERITEMS table, which of the following commands will drop the constraint?
ALTER TABLE orderitems DROP PRIMARY KEY
If the constraints on the ORDER# and ITEM# columns of the ORDERITEMS table were created as a PRIMARY constraint, and the actual constraint name is not known, which of the following commands can be used to delete the constraint
ALTER TABLE orderitems DROP PRIMARY KEY;
If a PRIMARY KEY constraint, named ORDERITEMS_PK, for the ORDER# and ITEM# columns of the ORDERITEMS table have been disabled, which of the following commands will enable the constraint
ALTER TABLE orderitems ENABLE CONSTRAINT orderitems_pk;
When a constraint is created at the table level, the constraint definition is provided ____ the column definition list.
After
In the USER_CONSTRAINTS view, the value displayed in the CONSTRAINT_TYPE column will be a(n) ____ for a CHECK constraint
C
The ____ constraint requires that a specific condition be met before a record can be added to a table.
CHECK
The NOT NULL constraint can only be created at the ____ level
COLUMN
Based on the structure of the ORDERITEMS table, which of the following commands was most likely used to create the table?
CREATE TABLE orderitems (order# NUMBER (4), item# NUMBER(2), isbn VARCHAR2(10), qty NUMBER(3), NOT NULL (order#, item#));
The NOT NULL constraint can only be created at the ____ level.
Column
Which clause will allow you to disable a constraint?
DISABLE
Which of the following statements about a PRIMARY KEY is incorrect?
Each data value must be unique. XX
In a ""one-to-many"" relationship, which constraint is usually added to the ""many"" table?
FOREIGN KEY
Which keywords identify a column that, if it contains a value, it must match data contained in another table
FOREIGN KEY
Which of the following types of constraints is used to enforce referential integrity?
FOREIGN KEY
Which of the following is a valid statement?
"Constraints are rules used to enforce business rules, practices, and policies." Constraints prevent errors by not allowing data to be added to tables if the data violates specific rules. Constraints ensure the accuracy and integrity of data. all of the above
When a constraint is created at the table level, the constraint definition is provided ____ the column definition list
AFTER
Based on the structure of the PROMOTION table, which of the following commands will ensure that the value entered for the MINRETAIL column is less than the value entered for the MAXRETAIL column
ALTER TABLE promotion ADD CHECK ( minretail < maxretail);
Which of the following commands will add a UNIQUE constraint to the MINRETAIL column of the PROMOTION table?
ALTER TABLE promotion ADD CONSTRAINT orderitems_minretail_uk UNIQUE (minretail);
Based on the structure of the PROMOTION table, which of the following commands will add a PRIMARY KEY constraint to the GIFT column
ALTER TABLE promotion ADD PRIMARY KEY(gift);
Based on the structure of the PROMOTION table, which of the following commands will add a PRIMARY KEY constraint to the GIFT column?
ALTER TABLE promotion ADD PRIMARY KEY(gift);
Where does the Oracle12c server store information about objects in the database, including information about constraints?
In the data dictionary
A PRIMARY KEY constraint can be added to an existing table by using the ____ clause of the ALTER TABLE command.
MODIFY XX
A FOREIGN KEY constraint can only reference a column in another table that as been assigned a(n) ____ constraint.
NOT NULL
The ____ constraint prevents the user from adding a NULL value in the specified column.
NOT NULL
Which of the following constraints cannot be added to an existing table with the ADD clause of the ALTER TABLE command?
NOT NULL
Which of the following keywords must have been included during the creation of a FOREIGN KEY constraint to allow a row from the parent table to be deleted, even if it is referenced by a row in the child table
ON DELETE CASCADE
Which view will display the names of all the constraints that you own?
USER_CONSTRAINTS
Which of the following statements about creating constraints is incorrect?
When you create constraints at the column level, the constraint being created applies to the column specified XX
How can constraints be added to a table?
as part of the ALTER TABLE command XX
Which of the following is the standard abbreviation for the constraint NOT NULL?
nn
A PRIMARY KEY that consists of more than one column is called a(n) ____ key.
COMPOSITE
What is the syntax for the default constraint name provided by the Oracle 12c server?
SYS_Cn
If a constraint applies to more than one column, the constraint must be created at the ____ level
TABLE
Constraints are always enforced at the ____ level.
TABLE XX
When a constraint is created at the ____ level with the CREATE TABLE command, the constraint definition is simply included as part of the column definition.
TABLE XX
Constraints are always enforced at the ____ level.
Table
Which of the following statements about creating constraints is incorrect
The NOT NULL constraint can be created at either the column level or the table level.
The UNIQUE constraint differs from the PRIMARY KEY constraint in what way?
The UNIQUE constraint allows NULL values.
Which of the following statements about the FOREIGN KEY constraint is incorrect?
The constraint can reference any column in another table, even a column that has not been designated as the primary key for the referenced table
Which of the following is the standard abbreviation for the constraint FOREIGN KEY
_FK XX