3.1 Relational Databases: Terminology
3. The Relational Model
3. The Relational Model
- 3.1 Relational Databases: Terminology
- 3.2 Properties of Relations
- 3.3 Integrity Rules
- 3.4 Relational Algebra Operators
Databases: Case Example Ord_Aug
| Ord_Items
| |||||||||||||||||||||||||||||||||||||||||||||
Items
| Customers
|
Term
|
Meaning
|
Eg. from the given Case Example
|
Relation | A table | Ord_Aug, Customers, Items etc. |
Tuple | A row or a record in a relation. | A row from Customers relation is a Customer tuple. |
Attribute | A field or a column in a relation. | Ord_Date, Item#, CustName etc. |
Cardinality of a relation | The number of tuples in a relation. | Cardinality of Ord_Items relation is 8 |
Degree of a relation | The number of attributes in a relation. | Degree of Customers relation is 3. |
Domain of an attribute | The set of all values that can be taken by the attribute. | Domain of Qty in Ord_Items is the set of all values which can represent quantity of an ordered item. |
Primary Key of a relation | An attribute or a combination of attributes that uniquely defines each tuple in a relation. | Primary Key of Customers relation is Cust#. Ord# and Item# combination forms the primary Key of Ord_Items |
Foreign Key | An attribute or a combination of attributes in one relation R1 which indicates the relationship of R1 with another relation R2. The foreign key attributes in R1 must contain values matching with those of the values in R2 | Cust# in Ord_Aug relation is a foreign key creating reference from Ord_Aug to Customers. This is required to indicate the relationship between Orders in Ord_Aug and Customers. Ord# and Item# in Ord_Items are foreign keys creating references from Ord_Items to Ord_Aug and Items respectively. |
Leave a Comment