SQL Flashcards
Catalog
A named collection of schemas in an SQL environnement
INFORMATION_SCHEMA
Special schema always contained in a catalog and which provides information on all schemas in the catalog and all the elements descriptors in these schemas
Basic data types
- Numeric
- Boolean
- Character-string
- Bit-string
- Date and time
Additional data types
- Timestamp
- Interval
Domain
Name used with the attribute specification.
Makes it easier to change the data type for a domain that is used by numerous attributes
Type
User defined types (UDTs) are supported for object oriented applications. Use the command CREATE TYPE
Constraints
A relational model has 3 basic contraints types that are supported in SQL:
- Key constraint: a primary key value cannot be duplicated
- Entity integrity constraint: a primary key value cannot be null
- Referential integrity constraints: the foreign key must have a value that is already present as a primary key or may be null.
Attribute constraints
- Basic constraints:
- restrictions on attribute domain and null
- default value of an attribute
- not null constraints
- check clause
Key constraints
- Primary key clause: specifies one or more attributes that make up the primary key of a relation
- Unique clause: specifies alternate (secondary) keys
- Foreign key clause
Projection attribute
Attributes whose values are to be retrieved
Selection condition
Boolean condition that must be true for any retrieved tuple.