Chapter 4: Relational Data Model
Relation
- a named two-dimensional table of data 1. Each relation (or table) consists of a set of named columns and an arbitrary number of unnamed rows. Attribute, consistent with its definition, is a named column of a relation 2. Each row of a relation corresponds to a record that contains data (attribute) values for a single entity.
Composite key
- a primary key that consists of more than one attribute
Attribute inheritance
- a property by which subtype entities inherit values of all attributes and instances of all relationships of their supertype
Foreign key
- an attribute in a relation that serves as the primary key of another relation in the same database
Primary key
- an attribute or a combination of attributes that uniquely identifies each row in a relation, underlining
Four reasons to create an instance of your relational schema with sample data
1. The sample data allows you to test you assumptions regarding the design 2. The sample data provide a convenient way to check the accuracy of your design 3. The sample data help improve communications with users in discussing you design 4. You can use the sample data to develop prototype applications and to test queries
Removing multivalued attributes from tables
Atomic property of relations still undesirable characteristics
Three components of the RDBMS
S.I.M.: structure, integrity, manipulation 1. Data structure- tables, rows, columns 2. Data manipulation- SQL 3. Data integrity- business rules when manipulated
The Relational Data Model
a. Commercial RDBMS products from numerous vendors started to appear in 1980 i. Dominant technology for database management
Associative entities
do not have to have an identifier, and the (partial) identifier of a weak entity forms only part of a weak entity's primary key
Properties of relations that make them different from non-relational tables
i. Each relation (or table) in a database has a unique name ii. An entry at the intersection of each row and column is atomic (or single valued)each attribute has to be one value, no multivalued attributes are allowed iii. Each row is unique, no two rows in a relation can be identical iv. Each attribute (or column) within a table has a unique name v. The sequence of columns (left to right) is insignificant. The order of the columns in a relation can be changed without changing the meaning or use of the relation vi. The sequence of rows (top to bottom) is insignificant. As with columns, the order of the rows of a relation may be changed or stored in any sequence.
Sample database
i. Text statement have the advantage of simplicity ii. Relation is named with attributes in parenthesis iii. This allows the user to associate an order with the customer who submitted the order
