Deck 4: Constraints
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/132
Play
Full screen (f)
Deck 4: Constraints
1
Any constraint can be created at the table or the column level.
False
2
A primary key is usually given the abbreviation _pk in the constraint name if the name is assigned by the user.
True
3
The table level approach can be used to create any constraint, except a CHECK constraint.
False
4
Only one PRIMARY KEY constraint can exist for each table.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
5
A constraint name can consist of up to 10 characters.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
6
A FOREIGN KEY constraint will not allow a row containing a NULL value in the foreign key column to be added to the table.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
7
A foreign key constraint can only be created at the column level.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
8
A CHECK constraint requires that a data value meet a certain condition before the record is added to the database table.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
9
The CONSTRAINT keyword is required if the user is going to assign a name to a constraint.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
10
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.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
11
A constraint for a composite primary key must be created at the table level.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
12
Constraints are used to ensure the accuracy and integrity of the data contained in the database.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
13
Constraints are rules used to enforce business rules, practices, and policies.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
14
A constraint is always enforced at the table level.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
15
A NOT NULL constraint can only be created at the column level.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
16
A constraint can only be created as part of the CREATE TABLE command.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
17
The MODIFY clause is used with the ALTER TABLE command to add a PRIMARY KEY constraint to an existing table.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
18
A PRIMARY KEY constraint will make certain the column designated as the primary key does not contain a NULL value.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
19
A UNIQUE constraint is the same as a PRIMARY KEY constraint, except that it will accept NULL values.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
20
If a FOREIGN KEY constraint exists, then a record cannot be deleted from the parent table if that row is referenced by an entry in the child table.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
21
If a(n) constraint has been created for a table, it means the data values in that column must be unique and cannot contain NULL values. _________________________
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
22
If a data value violates a(n) , the entire row is prevented from being added to the table. _________________________
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
23
A(n) constraint is used to ensure that referential integrity exists between tables. _________________________
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
24
A constraint can be added to a table after the table has been populated with data even if the existing data violates the constraint.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
25
The ALTER TABLE command can be used to disable a constraint.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
26
A NOT NULL constraint can only be created at the level. _________________________
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
27
A constraint can be renamed using the ALTER TABLE command.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
28
The SYSDATE can be used as a condition in a CHECK constraint.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
29
The ALTER TABLE command with the ENABLE clause can be used to enable a constraint.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
30
The default name for a constraint is where n consists of a number that will make the name unique within the database. _________________________
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
31
A constraint name can consist of up to characters and numbers. _________________________
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
32
In the USER_CONSTRAINTS view, the constraint type for a PRIMARY KEY constraint will be listed as PK.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
33
A(n) can be created during the creation of a database table or added to a table afterwards. _________________________
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
34
When dropping a constraint, the user is always required to specify the name of the constraint being dropped.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
35
The clause of the ALTER TABLE command is used to add a PRIMARY KEY constraint to an existing table. _________________________
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
36
A is a rule used to ensure the accuracy of data stored in a database. _________________________
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
37
Any type of constraint for a single column can be created at the level. _________________________
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
38
With the exception of the NOT NULL constraint, constraints can be added to a table using the ADD clause of the ALTER TABLE command.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
39
A NOT NULL constraint is a special FOREIGN KEY constraint.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
40
Each column can only be included in one constraint.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
41
Which of the following statements about a PRIMARY KEY is incorrect?
A) It identifies which column(s) uniquely identify each record.
B) It can be NULL, as long as the FOREIGN KEY contains a value.
C) Each data value must be unique.
D) none of the above
A) It identifies which column(s) uniquely identify each record.
B) It can be NULL, as long as the FOREIGN KEY contains a value.
C) Each data value must be unique.
D) none of the above
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
42
A(n) constraint is a special CHECK constraint with the condition of IS NOT NULL. _________________________
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
43
The ALTER TABLE command with the clause can be used to disable a constraint. _________________________
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
44
When a FOREIGN KEY constraint is being created, the keyword is used to indicate the table being referenced. _________________________
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
45
Which of the following is a valid statement?
A) Constraints are rules used to enforce business rules, practices, and policies.
B) Constraints prevent errors by not allowing data to be added to tables if the data violates specific rules.
C) Constraints ensure the accuracy and integrity of data.
D) all of the above
A) Constraints are rules used to enforce business rules, practices, and policies.
B) Constraints prevent errors by not allowing data to be added to tables if the data violates specific rules.
C) Constraints ensure the accuracy and integrity of data.
D) all of the above
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
46
The constraint is used to ensure that a data value meets a specified condition before a record is added to a table. _________________________
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
47
If the ON DELETE CASCADE keywords are included when a(n) constraint is created, then if a row is deleted from the parent table, any corresponding records in the child table are also deleted. _________________________
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
48
Both the and column-level approaches to creating a constraint can be included in the same command. _________________________
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
49
A(n) constraint can only reference a column in the parent table that has been designated as the primary key for that table. _________________________
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
50
In a "one-to-many" relationship, which constraint is usually added to the "many" table?
A) UNIQUE
B) PRIMARY KEY
C) FOREIGN KEY
D) NOT NULL
A) UNIQUE
B) PRIMARY KEY
C) FOREIGN KEY
D) NOT NULL
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
51
Which of the following are used to enforce business rules?
A) syntax
B) functions
C) constraints
D) enforcers
A) syntax
B) functions
C) constraints
D) enforcers
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
52
In the USER_CONSTRAINTS view, the constraint type for a NOT NULL constraint will be listed as _________________________
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
53
A NOT NULL constraint can only be added to an existing table by using the clause with the ALTER TABLE command. _________________________
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
54
When dropping a(n) constraint, the name of the column does not need to be included in the ALTER TABLE command. _________________________
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
55
How can constraints be added to a table?
A) as part of the CREATE TABLE command
B) as part of the ALTER TABLE command
C) as part of the PRIMARY KEY command
D) both a and b
A) as part of the CREATE TABLE command
B) as part of the ALTER TABLE command
C) as part of the PRIMARY KEY command
D) both a and b
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
56
A(n) constraint will allow NULL values to be stored in the designated column. _________________________
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
57
The data contains information about objects included in the database. _________________________
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
58
The ALTER TABLE command can be used to an existing constraint. _________________________
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
59
The UNIQUE constraint differs from the PRIMARY KEY constraint in what way?
A) The UNIQUE constraint does not allow NULL values.
B) The UNIQUE constraint can be created at either the column level or the table level.
C) The UNIQUE constraint allows NULL values.
D) The UNIQUE constraint ensures that a specific condition is True before a data value is added to a table.
A) The UNIQUE constraint does not allow NULL values.
B) The UNIQUE constraint can be created at either the column level or the table level.
C) The UNIQUE constraint allows NULL values.
D) The UNIQUE constraint ensures that a specific condition is True before a data value is added to a table.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
60
The FOREIGN KEY constraint is usually placed on the side of a one-to-many relationship. _________________________
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
61
When a constraint is created at the table level, the constraint definition is provided ____ the column definition list.
A) before
B) after
C) in the middle of
D) between columns in
A) before
B) after
C) in the middle of
D) between columns in
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
62
A PRIMARY KEY that consists of more than one column is called a(n) ____ key.
A) multiple
B) composite
C) comprehensive
D) coherent
A) multiple
B) composite
C) comprehensive
D) coherent
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
63
Which of the following is the standard abbreviation for the constraint NOT NULL?
A) nn
B) nl
C) nv
D) nnv
A) nn
B) nl
C) nv
D) nnv
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
64
Which of the following statements about the FOREIGN KEY constraint is incorrect?
A) The constraint exists between two tables, called the parent table and the child table.
B) When the constraint exists, by default a record cannot be deleted from the parent table if matching entries exist in the child table.
C) 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.
D) When the keywords ON DELETE CASCADE are included in the constraint definition, a corresponding child record will automatically be deleted when the parent record is deleted.
A) The constraint exists between two tables, called the parent table and the child table.
B) When the constraint exists, by default a record cannot be deleted from the parent table if matching entries exist in the child table.
C) 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.
D) When the keywords ON DELETE CASCADE are included in the constraint definition, a corresponding child record will automatically be deleted when the parent record is deleted.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
65
When used with a FOREIGN KEY, the keyword REFERENCES refers to what?
A) reference integrity
B) relational integrity
C) referential integrity
D) relational constraint
A) reference integrity
B) relational integrity
C) referential integrity
D) relational constraint
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
66
Only one ____ constraint can exist for each table.
A) PRIMARY KEY
B) FOREIGN KEY
C) UNIQUE
D) CHECK
A) PRIMARY KEY
B) FOREIGN KEY
C) UNIQUE
D) CHECK
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
67
Constraints are always enforced at the ____ level.
A) table
B) column
C) row
D) database
A) table
B) column
C) row
D) database
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
68
Which of the following statements about creating constraints is incorrect?
A) If you do not provide a name for a constraint, the Oracle11g server will issue an error message.
B) There are two approaches for creating constraints: at the column level or the table level.
C) One industry convention is to use the format tablename_columnname_constraint type for the constraint name.
D) none of the above
A) If you do not provide a name for a constraint, the Oracle11g server will issue an error message.
B) There are two approaches for creating constraints: at the column level or the table level.
C) One industry convention is to use the format tablename_columnname_constraint type for the constraint name.
D) none of the above
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
69
Which view will display the names of all the constraints that you own?
A) DISPLAY_CONSTRAINTS
B) ALL_CONSTRAINTS
C) USER_CONSTRAINTS
D) TABLE_CONSTRAINTS
A) DISPLAY_CONSTRAINTS
B) ALL_CONSTRAINTS
C) USER_CONSTRAINTS
D) TABLE_CONSTRAINTS
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
70
Which of the following is the standard abbreviation for the constraint FOREIGN KEY?
A) fkey
B) fk
C) fky
D) frk
A) fkey
B) fk
C) fky
D) frk
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
71
Which keywords identify a column that, if it contains a value, it must match data contained in another table?
A) FOREIGN KEY
B) PRIMARY KEY
C) CHECK
D) UNIQUE
A) FOREIGN KEY
B) PRIMARY KEY
C) CHECK
D) UNIQUE
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
72
Which of the following statements about creating constraints is incorrect?
A) If a constraint applies to more than one column, the constraint must be created at the table level.
B) Using the column level approach, the definition of the constraint is included as part of the column definition.
C) When you create constraints at the column level, the constraint being created applies to the column specified.
D) The NOT NULL constraint can be created at either the column level or the table level.
A) If a constraint applies to more than one column, the constraint must be created at the table level.
B) Using the column level approach, the definition of the constraint is included as part of the column definition.
C) When you create constraints at the column level, the constraint being created applies to the column specified.
D) The NOT NULL constraint can be created at either the column level or the table level.
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
73
If a constraint applies to more than one column, the constraint must be created at the ____ level.
A) column
B) table
C) row
D) database
A) column
B) table
C) row
D) database
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
74
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.
A) table
B) column
C) database
D) row
A) table
B) column
C) database
D) row
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
75
The NOT NULL constraint can only be created at the ____ level.
A) table
B) column
C) database
D) both a and b
A) table
B) column
C) database
D) both a and b
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
76
What is the syntax for the default constraint name provided by the Oracle11g server?
A) SYS_Cn
B) PK_Cn
C) ORA_Cn
D) DEF_Cn
A) SYS_Cn
B) PK_Cn
C) ORA_Cn
D) DEF_Cn
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
77
Which of the following is not a constraint type in Oracle11g?
A) CHECK
B) UNIQUE
C) NOT NULL
D) REFERENCE
A) CHECK
B) UNIQUE
C) NOT NULL
D) REFERENCE
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
78
A PRIMARY KEY constraint can be added to an existing table by using the ____ clause of the ALTER TABLE command.
A) MODIFY
B) ADD
C) CONSTRAINT
D) none of the above
A) MODIFY
B) ADD
C) CONSTRAINT
D) none of the above
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
79
Which of the following types of constraints is used to enforce referential integrity?
A) UNIQUE
B) REFERS
C) FOREIGN KEY
D) CHECK
A) UNIQUE
B) REFERS
C) FOREIGN KEY
D) CHECK
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck
80
If the ____ keyword is included when a constraint is created, a constraint name must be provided by the user.
A) CONST
B) CONSTRAIN
C) CONSTRAINT
D) none of the above
A) CONST
B) CONSTRAIN
C) CONSTRAINT
D) none of the above
Unlock Deck
Unlock for access to all 132 flashcards in this deck.
Unlock Deck
k this deck