0% found this document useful (0 votes)
35 views

Relationship Databases

An entity relationship diagram models the relationships between database tables, with primary keys uniquely identifying records and foreign keys linking tables. This diagram shows a doctor table primary keyed to a patient table in a one-to-many relationship, with an appointments table joining them through foreign keys to represent a doctor seeing multiple patients but each patient only having one doctor.

Uploaded by

api-319187476
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

Relationship Databases

An entity relationship diagram models the relationships between database tables, with primary keys uniquely identifying records and foreign keys linking tables. This diagram shows a doctor table primary keyed to a patient table in a one-to-many relationship, with an appointments table joining them through foreign keys to represent a doctor seeing multiple patients but each patient only having one doctor.

Uploaded by

api-319187476
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Entity Relationship Diagram

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.

You might also like