A | B |
constraints | used to prevent invalid data entry into tables and are database rules |
column level constraints | references a single column and are defined in the CREATE TABLE statement as part of the column definition |
table level constraints | constraint definitions that are listed after all table columns have been defined |
NOT NULL constraint | requires that every row entered into the table must have a value |
Unique constraints | requires that every value or set of columns be unique or not have duplicate values |
Primary Key constraints | a constraint that defines a column or a set of columns that uniquely identify each row in a table they can also be defined on the table or column level |
Foriegn key Constraints | also called referential integirty constraints that form the relationship in a relational database |
child table | the table containing the foreign key |
parent table | the table containing the primary key |
The rule | before you define a foriegn key or referential integrity constraint you must first define the parent primary key |
On Delete Cascade | used when defining a foriegn key that enables the dependent rows in the child table to be deleted when a row in the parent table is deleted |
On Delete Set Null | Used to apply null values to the child row when a record in the parent table is deleted |
Check Constraint | explicitly defines a condition that must be met or specifies a condition that must be true for each row of data |
Alter Table statement | used to make changes to constraints in existing tables |
USER_CONSTRAINTS | that table that houses all of your constraints |
constraint_name | the column that keeps track of all constraint names in the USER_ CONSTRAINTS table |
CONSTRAINT_TYPE | the column used to keep track of all of the types of constraints in the USER_CONSTRAINT table |
DISABLE CONSTRAINT | to deactivate an integrity constraint |
CASCADE clause | disables dependent integrity constraints |
ENABLE constraints | to activate integrityconstraints currently disabled |
DROP constraints | removes a constraint from a table |
DROP column | allows users to delete a column from a table |