Databases

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/8

encourage image

There's no tags or description

Looks like no tags are added yet.

9 Terms

1
New cards
<p>Explain the general features of this database?</p>

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


2
New cards
<p>What is the primary key in this database for the orders table?</p>

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.

3
New cards
<p>What is the primary key for the customers table?</p>

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.

4
New cards
<p>What is an example of a foreign key?</p>

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

5
New cards
<p>What is wrong with this database?</p>

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


6
New cards
<p>How can you fix the data redundancy in this table?</p>

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

7
New cards
<p><span style="background-color: transparent;"><strong>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.</strong></span></p>

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


8
New cards
<p>What does this show?</p>

What does this show?

This shows the different entity relationships between entities

9
New cards
<p>What does this show?</p>

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