- 1Introduction
- 2Database history
- 3Relational database characteristics
- 4Customer contact system
- 5Tables and the primary key
- 6Linking tables
- 7The one-to-many relationship
- 8The many-to-many relationship
- 9The one-to-one relationship
- 10Database normalization
- 11The first normal form (1NF)
- 12The second normal form (2NF)
- 13The third normal form (3NF)
- 14The final database design
- 15Another example: webshop database
- 16Conclusion
Database design tutorial
The first normal form (1NF)
A database table is a representation of an "entity" in the system you are building. Examples of entities are order, customer, contact moment, product, etc. Each row in the database table represents one occurence of an entity. For example in a customer table each row will contain information about 1 customer.
- Each table has a primary key, consisting of the smallest possible number of fields. (A primary can be be made up of multiple fields).
- Atomicity: each field contains one value. An adres for example, would ideally be stored in three separate fields: street, number and possibly an extension. (Extensions are quite common in my country. Churchstreet 55 B, for example)
- The order of rows in a table should not matter. You may be inclined to use the order of rows in a customer table to determine which customer first registered. For this purpose you should create date and time fields that store the customer's subscription date and time. Row order will inevitably change when customers are deleted, modified and inserted. That is why you shouldn't rely on the order of rows in a table.
The next page of this database design tutorial discusses the second normal form (2NF)