1/8
Looks like no tags are added yet.

Explain the general features of this database?
Two tables (entities) : orders and customers
There are different fields (attributes) in each field:
Orders table has order_id, product, total and customer id
Customers table has customer_id, firstname, lastname, phone and country
A record (tuple) is any complete row in either table

What is the primary key in this database for the orders table?
For the orders table, order_id is the primary key for the table, as this can be used to separate each order regardless of whether each other attribute is the same, as the order id is unique.

What is the primary key for the customers table?
Similarly, for the customers table, the customerid is the primary key for customers table as this can be used to separate each order regardless of whether each other attribute is the same, as the customer id is unique.

What is an example of a foreign key?
customerid is a foreign key, as it links an order back to the customer that made the order in the customer table

What is wrong with this database?
In this flat file table, there is redundant data - the tutor and form room information repeats, which is inefficient.
If a tutor changed their name we would need to find all instances of that name and change them all
Missing any would mean the table had inconsistent data

How can you fix the data redundancy in this table?
a new table could be created to store the tutor information and the tutor information in the student table could be moved to the new table.
Then a foreign key in the student table (TutorID) could link a student to their tutor
this means that if they change only one piece of data, the data is updated in the entire database and inconsistency is avoided

Customers’ details are stored in the flat file database table Customer. An extract of the table is shown below. Describe one problem that would arise with the flat file database structure if a customer wanted to insure more than one car at the same time.
Only one customer entry allowed so could not add second entry
Customer data already present would be repeated, resulting in redundant data/wasted space/ inconsistencies should changes be made

What does this show?
This shows the different entity relationships between entities

What does this show?
Many to many relationships cannot be implemented into an actual database and need to be ‘resolved’
This involves creating a new table known as a ‘link’ table that goes between the entities
This new table links the entities that have the many to many relationships together