8 October 2019
Database(16) -- Review(1)
by Jerry Zhang
A data model
structure of the data. Operations on the data. Constraints on the data.
Two data models
- The relational model, including the object-relational extension.
- The semistructured-data model, including XML and related standards.
A set of attributes forms a key for a relation if we do not allow two tuples in a relation instance to have the same values in all the attributes of the key.
Relations in SQL
three kinds of relations:
- Stored relations, which are called tables.
- Views, which are relations defined by a cumputations.
- Temporary tables, which are constructed by the SQL language processor when it performs its job of executing queries and data modifications.
CREATE TABLE
Data types
- Character strings of fixed or varying length.
- Bit strings of fixed or varying length.
- The type BOOLEAN denotes an attribute whose value is logical. TRUE, FALSE, UNKNOWN
- The type INT or INTEGER denotes typical integer values. SHORTINT
- FLOAT or REAL; higher precision: DOUBLE PRECESION
- DATE and TIME