Unit 7 Relational databases and SQL Comp sci
- Created by: Penfred
- Created on: 05-05-21 09:52
Fullscreen
Section 7 - Relational databases and SQL
The concept of a database
All databases contain one or more tables
Each record (row) has several fields ( column )
A record can also have a unique identifier known as the primary key, no two records can have the same primary key.
The concept of a relational database
In a relational database, several tables are linked by a common field. The reason we do this instead of one big table is to minimise errors and not have the same piece of data appearing more than once.
A table can use another table's primary key as a foreign key. This links the two tables together.
There are several ways 2 tables can be connected for example it can be
A one to one relationship (eg headmaster and school)
A one to many relationship (eg pond and fish )
A many to many relationship ( eg…
Comments
No comments have yet been made