HW 04 Study Set
Which of the following statements about creating constraints is incorrect?
The NOT NULL constraint can be created at either the column level or table level.
A FOREIGN KEY constraint can be added to the column of a table to ensure that the referenced data value actually exists in the other table.
True
A primary key is usually given the abbreviation _pk in the constraint name if the name is assigned by the user.
True
A(n) FOREIGN KEY constraint can only reference a column in the parent table that has been designated as the primary key for that table. _________________________
True
A(n) UNIQUE constraint will allow NULL values to be stored in the designated column. _________________________
True
Any type of constraint for a single column can be created at the column level. _________________________
True
Constraints are used to ensure the accuracy and integrity of the data contained in the database.
True
The CONSTRAINT keyword is required if the user is going to assign a name to a constraint.
True
Which of the following is the standard abbreviation for the constraint NOT NULL?
nn
A PRIMARY KEY constraint can be added to an existing table by using the ____ clause of the ALTER TABLE command.
ADD
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 PRIMARY KEY 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;
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);
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
Which clause will allow you to disable a constraint?
DISABLE
A constraint can only be created as part of the CREATE TABLE command.
False
Any constraint can be created at the table or the column level.
False
If the ON DELETE CASCADE keywords are included when a(n) PRIMARY KEY constraint is created, then if a row is deleted from the parent table, any corresponding records in the child table are also deleted. _________________________
False
The FOREIGN KEY constraint is usually placed on the "one" side of a one-to-many relationship. _________________________
False
The SYSDATE can be used as a condition in a CHECK constraint.
False
Where does the Oracle 12c server store information about objects in the database, including information about constraints?
In the data dictionary
The ____ constraint prevents the user from adding a NULL value in the specified column.
NOT NULL
Based on the structure of the ORDERITEMS table, which of the following commands will add a NOT NULL constraint to the ISBN column?
None of the above