Week 4 Flashcards
What are four basic SQL operations?
Create, Read, Update, and Delete (CRUD)
What does DDL stand for?
Data definition language - used to define, change, or drop database objects
What does DML stand for?
Data manipulation language - used to read and modify data
What does DCL stand for?
Data control language - used to grant and revoke authorizations
How can you create a table in SQL?
create table myTable (myColumn1 integer)
What are some 7 basic data types in SQL?
integer, float, decimal, char, date, time, blob
What does a UNIQUE constraint do?
A UNIQUE constraint prevents duplicate values in a table. This is implemented using unique indexes and is specified in the CREATE TABLE statement using the keyword UNIQUE. A NULL is part of the UNIQUE data values domain.
What does a PRIMARY KEY constraint do?
A PRIMARY KEY constraint is similar to a UNIQUE constraint, however, it excludes NULL as valid data. Primary keys always have an index associated with them. This defines a primary key for the table.
What does a REFERENTIAL constraint do?
A REFERENTIAL constraint is used to support referential integrity which allows you to manage relationships between tables.
What does a A CHECK constraint do?
A CHECK constraint ensures the values you enter into a column are within the rules specified in the constraint.
Can Referential integrity be defined during and after a table is created?
Referential integrity can be defined during table definition or after the table has been
created.
What is the name of a table whose column values depend on the values of other tables?
A table whose column values depend on the values of other tables is called a dependent, or
child table
What is a base or parent table?
A table being referenced by a child table or dependent.
When the constraint name is not specified what will happen in DB2?
The DB2 system will generate the name automatically
What are some delete action types?
A delete action type can be a CASCADE, SET NULL, NO ACTION, or RESTRICT.
What are some update action types?
An update action type can be a NO ACTION or RESTRICT.