- 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
Database history
In the seventies and eighties, when computer scientists still wore brown tuxedo jackets and large glasses, data were often stored in so called 'flat files'. Flat files are text documents in which data are seperated by (usually) comma's or tabs. Flat files are still in use today. The Comma Seperated Values (CSV) format is very popular and widely supported by different software and operating systems. Microsoft Excel is one popular application that can handle CSV files. The data contained in a flat file can be read by a computer program.
'tutorial_id', 'title', 'category'
'1','Access Tutorial','Software'
'2','Excel Tutorial','Software'
'3','Database design tutorial','Software'
'4','Oracle DBA Course ','Software'
'5','Raid Storage Tutorial ','Hardware'
'6','Network Security Tutorial','Networks'
Above is an example of what a flat file could look like. A program reading this flat file would understand that the data are separated by comma's. If it wanted to select the category that the 'Database Design Tutorial' is in, it would have to read the file line by line until it fiends 'Database Design Tutorial' and then read the next word after the comma.
In a typical relational database model, data are stored in separate tables. The database table below contains the same data as the flat file.
| tutorial_id | title | category |
| 1 | Access Tutorial | Software |
| 2 | Excel Tutorial | Software |
| 3 | Database design tutorial | Software |
| 4 | Oracle DBA Course | Software |
| 5 | Raid Storage Tutorial | Hardware |
| 6 | Network Security Tutorial | Networks |
In this table a program could search a tutorial_id in the tutorial_id column to quickly find the corresponding title and category. From a relational database advanced data selections can be made from specific rows, columns and even from multiple tables at once. The tutorial_id field is called the 'primary key'. It can be used to link the data in the table above to data contained in other tables. (More about this later).
The relational database model was invented in the seventies by Ted Codd, a British computer scientist. He wanted his model to overcome the shortcomings of the network database model and the hierarchical database model. He succeeded very well. The relational database model is now widely adopted and considered a powerful model for the efficient organisation of data. Today, a wide range of relational database products are available, ranging for light-weight desktop applications to feature-packed server systems with highly optimized retrieval methods. Some of the best known Relational Database Management Systems (RDBMS) are listed below.
- Oracle. Mainly used for professional, large applications
- Microsoft SQL server. Microsofts' professional RDMS. MSSQL is available only for the Windows operating system.
- Mysql. Mysql is a very popular open source relational database system. Mysql is widely used in the open source community and by either hobbyists and beginners as professionals worldwide. Mysql is available for free.
- IBM has a range of database system, from which DB2 is the best known.
- Microsoft Access is a simple RDBMS for use at home or in the office.
In general a relational database model is not designed for a specific RDBMS. A relational database model can be implemented on any relational database system. On the next page of this database design tutorial I will discuss some of the characteristics of relational databases.