Computer-Science-A-level-Ocr
-
3-3-networks8 主题
-
3-2-databases7 主题
-
3-1-compression-encryption-and-hashing4 主题
-
2-5-object-oriented-languages7 主题
-
2-4-types-of-programming-language4 主题
-
2-3-software-development5 主题
-
2-2-applications-generation6 主题
-
2-1-systems-software8 主题
-
1-3-input-output-and-storage2 主题
-
1-2-types-of-processor3 主题
-
1-1-structure-and-function-of-the-processor1 主题
-
structuring-your-responses3 主题
-
the-exam-papers2 主题
-
8-2-algorithms-for-the-main-data-structures4 主题
-
8-1-algorithms10 主题
-
7-2-computational-methods11 主题
-
7-1-programming-techniques14 主题
-
capturing-selecting-managing-and-exchanging-data
-
entity-relationship-diagrams
-
data-normalisation
-
relational-databases
-
hashing
-
symmetric-vs-asymmetric-encryption
-
run-length-encoding-and-dictionary-coding
-
lossy-and-lossless-compression
-
polymorphism-oop
-
encapsulation-oop
-
inheritance-oop
-
attributes-oop
-
methods-oop
-
objects-oop
-
capturing-selecting-managing-and-exchanging-data
-
6-5-thinking-concurrently2 主题
-
6-4-thinking-logically2 主题
-
6-3-thinking-procedurally3 主题
-
6-2-thinking-ahead1 主题
-
6-1-thinking-abstractly3 主题
-
5-2-moral-and-ethical-issues9 主题
-
5-1-computing-related-legislation4 主题
-
4-3-boolean-algebra5 主题
-
4-2-data-structures10 主题
-
4-1-data-types9 主题
-
3-4-web-technologies16 主题
-
environmental-effects
-
automated-decision-making
-
computers-in-the-workforce
-
layout-colour-paradigms-and-character-sets
-
piracy-and-offensive-communications
-
analysing-personal-information
-
monitoring-behaviour
-
censorship-and-the-internet
-
artificial-intelligence
-
the-regulation-of-investigatory-powers-act-2000
-
the-copyright-design-and-patents-act-1988
-
the-computer-misuse-act-1990
-
the-data-protection-act-1998
-
adder-circuits
-
flip-flop-circuits
-
simplifying-boolean-algebra
-
environmental-effects
relational-databases
Relational Databases
What is a database?
-
A database is an organised collection of data
-
It allows easy storage, retrieval, and management of information
-
Electronic databases offer a number of key benefits:
-
Easier to add, delete, modify and update data
-
Data can be backed up and copied easier
-
Multiple users, from multiple locations, can access the same database at the same time
-
Database terminology
|
Term |
Definition |
|---|---|
|
Field |
A single piece of data in a record |
|
Record |
A group of related fields, representing one data entry |
|
Table |
A collection of records with a similar structure |
|
Primary key |
A unique identifier for each record in a table. Usually an ID number |
|
Compound primary key |
A combination of (2 or more) fields that is unique for all records |
|
Foreign key |
A field in a table that refers to the primary key in another table. Used to link tables and create relationships |
|
Secondary key |
A field or fields that are indexed for faster searching |
|
Database Management System |
Software used to manage databases. Examples include MySQL, Oracle, Microsoft SQL Server, PostgreSQL |
Primary, Foreign & Secondary Keys
Visualising a database

-
This database has 2 tables : orders and customers
-
Fields:
-
In the orders table are order_id, product, total and customer_id
-
In the customers table are customer_id, first_name, last_name, phone and country
-
-
A record would be 1 complete row in either table
-
order_id is the primary key for the orders table
customer_id is the primary key for the customers table -
In the orders table customer_id is a foreign key – it links an order back to the customer that made the order in the customer table
Indexing (secondary keys)
-
Indexing is a technique used to speed up data retrieval in a database
-
It works in a similar way to the index in a book
-
If a student had a maths book and wanted to find the section on factorising, they could start at the first page and look at each page in turn until they found the section they wanted
-
But this would be slow, so it is better to look in the index to find where the factorising section is and just go directly to it
-
Likewise in a database, certain columns can be indexed so that the DBMS does not have to look at every single record during a search and can just go to the relevant records directly
-
This can greatly speed up searches
-
Fields that are indexed are known as secondary keys
Flat File vs Relational Database
-
A flat file database is one that stores all data in a single table
-
It is simple and easy to understand but causes data redundancy, inefficient storage and is harder to maintain
-
A relational database is one that organises data into multiple tables
-
It uses keys to connect related data which reduces data redundancy, makes efficient use of storage and is easier to maintain
-
Consider this example flat file table of students

-
This table has redundant data – the tutor and form room information repeats
-
This 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
-
A relational database would solve this issue:
-
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
-

-
Now the name of each tutor and their form room is stored only once
-
This means if they change only one piece of data, the data is updated in the entire database and Inconsistency is avoided
Worked Example
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
[2]
Answer:
One mark per pair:
Only one customer entry allowed (because of key field)…
so would not be able to add second entry [1]
Customer data already present/would be repeated…
resulting in redundant data/wasted space/inconsistencies should changes be made [1]
Responses