Databases Tables
Tables
A table is a collection of data about a specific topic, such as students or
contacts. The specific topic is called a Data entity. A data entity is a real world object about which we wish to store data. A golden rule is "one data entity one table." Using a separate table for each data entity means that you store that data only
once, which makes your database more efficient, and reduces data-entry error.

Making a database.
An example of this process comes from the doctors surgery. If you were making appointments for the doctor how many tables would you use? The correct answer is three ! Because there are three data entities. The doctor is one data entity. The patient is another (you only need one table for all of the patients; as you are storing all of the same details for each patient each patient will be a record (or row) in the patients table. The third table? that's the appointments. The surprising thing is they are a separate real world object too. The time and place of the appointment are unique to the appointment the people who are meeting there are derived values form the other two tables.
Why do you need a table for the appointment? Well, if you placed the appointments time and date in the patients record as most people tend to do, when the patient has a second appointment you need to enter all of the patients data again. A potential source of errors and taking up computer memory and receptionist time needlessly. |