General notes
A checklist of things to do when designing a database.
Identify and define all entities
For each entity you want to include in your database, define every meaningful attribute. Remember to add a unique integer attribute; it will be used as a primary key for each tuple.
Normalize the entities
- [1NF] each attribute must have one and only one value (or NULL)
- [2NF] each attribute in the relation must be functionally dependent upon the primary key
- [3NF] all attributes that are not dependent upon the primary key must be eliminated
Create the database
- create a table for each entity
- add a column for each entity's attribute
- create a foreign key for each element involved in a 1-1 relation
- create an additional table for each n-n relation (use primary keys as columns and create the needed foreign keys)