| member_id | fname | lname | tel | |
|---|---|---|---|---|
| 1 | Peter | Lloyd | 410380 | pl@zircon.co.za |
| 2 | Denise | Quin | 8221653 | dq@zircon.co.za |
| 3 | Vivienne | Lloyd | 0655455 | vml@icon.co.za |
The rows of a database are not automatically arranged in any particular order so they can be sorted alphabetically , numerically or by any other criteria.
It is important , therefore , to have some means to identify each record in the table. The table above allocates "a member id" for this purpose
and this is known as the PRIMARY KEY.
Storing data in a single table is very useful but relational databases with multiple tables introduce more possibilities
by allowing data to be combined in different ways. For example , the following two tables could be added to the database in the above example.
| video_id | title |
|---|---|
| 1 | Titanic |
| 2 | Men in Black |
| 3 | Star Wars |
| member_id | video_id |
|---|---|
| 1 | 3 |
| 2 | 1 |
| 3 | 2 |
Thr three tables define a number of relationships.