
Database - How To Movies |
||||
| 1. Setting up and creating tables and fields | 2. Formatting Fields. | 3. Creating Primary Key and Relationships | 4. Searching and Creating Reports | 5. Editing Reports |
Database
Implementation
Once the data model is completed, the database can be constructed. This involves three stages:
1. set-up the tables
2. populate the tables
3. manipulate and present the data.
Let’s look at each of these stages in turn for the DVD rentals case study.
Setting up the tables
In order to set-up the tables in the database, you must decide:
1. Which tables are required?
The tables correspond directly to the entities in the data model. In this case, there will be two tables, Member and DVD Rental.
2. Which fields are required?
As before, the fields in each table are the attributes in each entity in the data model.
| Table | Member | Table | DVD Rental |
| Fields | Member Number | Fields | DVD Code |
| Name | Title | ||
| Telephone Number | Cost | ||
| Date Out | |||
| Date Due | |||
| Member Number |
3. What are the properties of each field?
For each field in the database, you must consider the following.
| (i) Its name | You should take care to choose sensible field names and make sure that your naming is consistent in each table. For example, if you choose to abbreviate Member Number to Member No. (rather than Member Num. or Member #), you should also abbreviate Telephone Number to Telephone No. |
||||||||||||||
| (ii) The data type | This may be one of the following.
|
||||||||||||||
| (iii) Validation |
|
It is often useful to record this information about tables and fields in a table called a data dictionary. This allows the database to be implemented using any database management system.