Relational Databases Flashcards
(198 cards)
CONSTRAINT
Optional keyword followed by the constraint named and declaration
CHECK
Specifies an expression on one ore more columns of a table. Constraint is violated when the expression is FALSE and satisfied when the expression is either TRUE or NULL
UNIQUE
Constraint that ensures values in a column, or group of columns, are unique
Table Constraint
governs values in one or more columns
Column Constraint
Govern values in a single column
Constraint
ruled that governs allowable values in a database. Constraints are based on relation and business rules, and implemented with special keywords in a CREATE TABLE statement.
ON UPDATE/ON DELETE
Actions are specified in the optional ON UPDATE and ON DELETE clauses of the FOREIGN KEY constraint
CASCADE
propagates primary key changes to foreign keys
SET DEFAULT
Sets invalid foreign keys to the foreign key default value
SET NULL
Sets invalid foreign keys to a NULL
RESTRICT
Rejects an insert, update or delete that violates referential integrity
Referential Integrity
Relational Rule that requires foreign key values are either fully NULL or match some primary key value
Fully NULL
Foreign key is a simple or composite foreign key in which all columns are NULL
Foreign Key/References
Constraint is added to a CREATE TABLE statement with the FORIEGN KEY and REFERENCES keywords.
Referential integrity
Requires a foreign key values must either be NULL or match some value of the referenced primary key.
Foreign Keys
A Column or group of columns that refer to a primary key
AUTO_INCREMENT
Defines an auto-increment column. Command follows the columns data type in a CREATE TABLE statement
Auto-increment Colum
Numeric column that is assigned an automatically incrementing value when a new row is inserted
PRIMARY KEY
Constraint in a CREATE TABLE statement names the tables primary key.
Composite Primary Key
Primary key consisting of multiple columns
Simple Primary Key
A primary key that consist of a single Column
Primary Key
A Column, or group of columns, used to identify a row
TRUNCATE
Statement that deletes all rows from a table
FROM
Keyword is followed by the table now whose rows are to be deletedT