Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Summary

Summary Full Notes - Chapter 8 - Databases - CIE Computer Science

Rating
-
Sold
-
Pages
10
Uploaded on
09-07-2026
Written in
2025/2026

Full notes for Chapter 8: Databases of the CIE A-Level Computer Science course (9618). Notes are written fully according to the specification and all past paper mark schemes.

Institution
Course

Content preview

​8. Databases​

​1. Introduction to Databases​

​A database is a structured/organised way to store data so that it can be retrieved easily using queries​

​●​ A ​ record/tuple is a single row/entry of data​
​in the table, about one instance of an object​
​●​ ​A field/attribute is a column of data or an​
​attribute of a record​
​●​ ​An entity is an object that can have data​
​stored about it e.g. an animal - a tuple is one​
​instance of an entity​


​Data types:​
​●​ ​CHAR(n) - fixed length text of​​n​​characters (or single​​character)​
​●​ ​VARCHAR(n) - variable length text upto​​n​​characters​
​●​ ​BOOLEAN - true or false (1 or 0)​
​●​ ​INTEGER - whole number​
​●​ ​REAL - number with decimal value​
​●​ ​DATE - date, typically formatted as YYYY-MM-DD​
​●​ ​TIME - time, typically formatted as HH:MM:SS​

​Flat-file database:​
​●​ ​A flat file database stores a single table of data inside a single text file​
​●​ ​Flat file databases are often stored using a .csv (comma separated values) format​
​○​ ​Each record appears on a separate line​
​○​ ​Each field is separated by a comma​
​●​ ​This format is very easy to set up, however is hard to manage for anything remotely complicated​
​●​ ​However, there are two problems with flat-file databases:​
​○​ ​Data redundancy - the same data is repeated unnecessarily e.g. in a students database,​
​multiple will have the same form/house/form teacher/form room etc.​
​○​ ​Data inconsistency - when redundant data causes errors in data such as update errors e.g.​
​one person has Dr Quirke as their form tutor, and another has Dr Qirke​

​Keys:​
​●​ K ​ eys are pointers used to refer to specific records in database tables​
​●​ ​They minimise the number of copies of data needed and provide relationships between tables​
​●​ ​Candidate key - an attribute in a table where no tuple has the same value (unique), so could be​
​the primary key​
​●​ ​Primary key - the designated field that stores unique data for each record in a table to be able to​
​identity each record/tuple e.g. StudentID​
​●​ ​Secondary key - a candidate key field that could be a primary key (unique and not null) but has​
​not been chosen - may be used to locate specific data​
​●​ ​Foreign key - a field in one table that is a primary key of another table in the database, used to​
​form relationships between the tables (used for relational databases)​
​●​ ​An index is a data structure which uses one or more columns/fields (e.g. primary key/secondary​
​key) to speed up searching for records in a database table​

, ​2. Introduction to SQL​

​DBMSs (Database Management System) use a data definition language and data manipulation language:​
​●​ ​DDL (Data Definition Language) is used for working on the database structure (create/modify/​
​remove data structures that form a relational database) - DDL statements are written as scripts​
​●​ ​DML (Data Manipulation Language) is used to work with the data stored in the database​
​(add/modify/delete/retrieve data stored in a relational database)​
​●​ ​SQL is the industry standard commonly used for both​

​ QL (Structured Query Language) is a language used to create, query, update and delete data to and​
S
​from databases​
​●​ ​SQL is used within most Database Management Systems e.g. MySQL, SQL Server and MS Access​
​●​ ​SQL queries can be used within high level programming languages e.g. Python, Visual Basic, C#​

​SELECT statement (DML query commands):​
​●​ ​The SELECT statement is used to extract fields from one or more tables​
​○​ ​SELECT - list of fields to be displayed​
​○​ ​FROM​​- list the table or tables the data will come from​
​○​ ​WHERE - list of search criteria​
​■​ ​Operators: = <> > < >= <= AND, OR, NOT​
​■​ ​LIKE is used to search for a pattern​
​●​ ​% can represent 0, 1 or more characters​
​●​ ​_ represents one character​
​●​ ​E.g. WHERE FirstName LIKE “W%e_”​
​■​ ​BETWEEN is for between an inclusive range e.g. WHERE ID BETWEEN 1 AND 5​
​■​ ​IN used to specify multiple values​
​■​ ​ORDER BY - list the fields that the data is to be sorted on​
​■​ ​ASC/DESC e.g. ORDER BY ProductID DESC​
​■​ ​Note: use ‘_’ for single chars and dates (or sometimes #), otherwise use “_"​
​●​ ​The wildcard (*) can be used to select all the fields​
​e.g.​ ​SELECT *​
FROM Students​

WHERE House IN (“Evans”, “Black Hawkins”) AND Form LIKE “T__3” AND​

Teacher LIKE “Mrs%” AND Age BETWEEN 16 AND 17​

ORDER BY Pupil ID DESC;​


​INSERT INTO statement (DML maintenance command):​
​●​ ​Used to insert a new record into a table​
​INSERT INTO​​TableName​​(​FieldNames​​)​
​VALUES (​​Values​​)​
​e.g.​​
INSERT INTO Students (ID, FirstName, House)​
VALUES (32, “William”, “Evans”);​


​UPDATE statement:​ ​DELETE statement:​
​●​ ​Used to update a record in a table​ ​●​ ​Used to delete a record in a table​
​UPDATE​​TableName​ ​DELETE FROM​​TableName​
​SET​​Field1​​=​​Value1, Field2 = Value2 …​ ​WHERE​​FieldName​​=​​Value​
​WHERE​​FieldName​​=​​Value​ ​e.g.​​
DELETE FROM Students​
​e.g.​​UPDATE Students​ WHERE Name = “William”;​

SET House = “Olders”​

WHERE Name = “William”;​

Written for

Study Level
Examinator
Subject
Unit

Document information

Uploaded on
July 9, 2026
Number of pages
10
Written in
2025/2026
Type
SUMMARY

Subjects

$9.65
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
benjaminskn18

Also available in package deal

Get to know the seller

Seller avatar
benjaminskn18 UCS
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
3 days
Number of followers
0
Documents
21
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions