Relationship Databases
Relationship Databases
Usman Ali
An entity relationship diagram represents the relationship between the tables in a database. The diagram represents which
field is the primary key, in this case the doctor and patients table is a one to many relationship as a doctor can see many
patients but a patient can only have one doctor.
This database structure will be set up as a relational database which means there is more than one table and they
are connected together by links called relationships.
All tables have a primary key which makes a particular field distinctive and allows every record in the table to be
recognised.
A foreign key is used to combine tables together and produce a relationship with a primary key in a different table.
In this scenario, the primary keys are appointment ID, Patients ID and Doctors ID. The foreign keys are Doctor ID in
the appointments and patients table.