In relational database model, the data is organized into tables(i.e. , rows and columns). These table are called relations. A row in a table represents a relationship among a set of values. Since a table is a collection of such relationships, it is generally referred to using the mathematical term, relation, from which the relational database model derives its name.
Let us see how a sample database can be represented in relational form. The sample database being shown here has three tables(relations): Suppliers, items, shipments.
| SuppNo | Supp_name | Status | City |
| S1 | Britannia | 10 | Delhi |
| S2 | New Bakers | 30 | Mumbai |
| S3 | Mother Dairy | 10 | Delhi |
| S4 | Cookz | 50 | Bangalore |
| S5 | Haldiram | 40 | Jaipur |
| ItemNo | Item_Name | Price |
| I1 | Milk | 15.00 |
| I2 | Cake | 5.00 |
| I3 | Bread | 9.00 |
| I4 | Milk Bread | 14.00 |
| I5 | Plain biscuit | 6.00 |
| I6 | Cream biscuit | 10.00 |
| I7 | Ice Cream | 16.00 |
| I8 | Cold drink | 8.00 |
| I9 | Namkeen | 15.00 |
| SuppNo | ItemNo | Qty_supplied |
| S1 | I2 | 10 |
| S1 | I3 | 20 |
| S1 | I6 | 20 |
| S2 | I4 | 20 |
| S2 | I5 | 10 |
| S3 | I1 | 10 |
| S3 | I7 | 10 |
| S4 | I8 | 30 |
| S5 | I9 | 30 |
In the above tables SuppNo, ItemNo, are the primary keys.
- A primary key is the key-field which can uniquely identify a row in a relation.
Notice that here each supplier has unique supplier number, exactly one name, status value and location.. Likewise, we assume that each item has a unique item number, name and price; and also that, at any given time no more than one shipment exists for a given supplier/item combination.
Each of these three tables closely resembles a conventional sequential file, with rows of the table corresponding to records of file and columns corresponding to fields of the records. Each of these tables is actually a special case of construct known in mathematics as a relation.
Rows of relation are generally known as tuples and columns are referred to as attributes.
Leave a comment