0% found this document useful (0 votes)
2 views8 pages

Database Questions

The document provides comprehensive revision notes on relational databases, covering key concepts such as data vs. information, data validation and verification, benefits of relational databases, relationships in databases, referential integrity, entity relationship diagrams, SQL essentials, normalization, and key vocabulary. It also includes practical examples and questions related to database design and management, specifically tailored for IB Computer Science SL students. The notes emphasize the importance of structured data management and the application of relational database principles in real-world scenarios.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views8 pages

Database Questions

The document provides comprehensive revision notes on relational databases, covering key concepts such as data vs. information, data validation and verification, benefits of relational databases, relationships in databases, referential integrity, entity relationship diagrams, SQL essentials, normalization, and key vocabulary. It also includes practical examples and questions related to database design and management, specifically tailored for IB Computer Science SL students. The notes emphasize the importance of structured data management and the application of relational database principles in real-world scenarios.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

🧠 IB Computer Science SL – Option A:

Relational Databases Full Revision Notes

📊 0. Data vs Information
Term Definition Example
Data Raw facts or values without context. 95, "Jason", 12/06/2025
Processed data given context and "Jason got 95/100 on the final
Information exam"
meaning.

• Data alone is not useful until it is processed.


• Information is meaningful and useful to the user.
• Computers process data → output information.

✅ 1. Data Validation vs Verification


Concept Definition & Purpose Examples
Ensures input data follows expected Email must have @domain.com,
Validation
format and rules age 0–120
Ensures data entered is accurate and Re-entering passwords,
Verification
matches expected values CAPTCHA, checksums

🗃 2. Why Use a Relational Database?


Benefits of an RDBMS:

• Reduces data redundancy


• Maintains data integrity
• Supports multi-user access
• Scalable for large applications
• Referential integrity ensures consistent relationships
• Structured using SQL for powerful data manipulation

🔗 3. Relationships in Databases
Type Description Example
1:1 One record ↔ one record One user ↔ One passport
1:N One record → many records One customer → many orders
M:N Many ↔ many Students ↔ Courses (via linking table)

✅ Many-to-Many must be implemented via a junction table.

🧾 4. Referential Integrity
• Enforces logical links between related tables.
• Foreign keys must match primary keys in the referenced table.
• Prevents “orphan” records and data inconsistencies.
• Ensured via constraints and foreign key rules in the DBMS.

🧰 5. Entity Relationship Diagrams (ERDs)


Components:

• Entity = Table
• Attribute = Field (column)
• Primary Key (PK) = Unique identifier
• Foreign Key (FK) = References another table
• Relationship = Line connecting two entities
• Cardinality = Specifies how many matches exist

Example:

• Student(StudentID, Name)
• Course(CourseID, Title)
• Enrollment(StudentID, CourseID) ← junction table

🔢 6. Cardinality in ERDs
Type Description ERD Notation (Crow’s Foot)
1:1 One to one
1:N One to many
M:N Many to many >—<

• 1:N is the most common in real-world systems.


• M:N must be resolved with a junction/intermediate table.

💾 7. SQL Essentials (DML, DDL, DQL)


Create Table:
CREATE TABLE Students (
ID INT PRIMARY KEY,
Name VARCHAR(50),
Age INT
);

Insert, Update, Delete:


INSERT INTO Students VALUES (1, 'Ali', 17);
UPDATE Students SET Age = 18 WHERE ID = 1;
DELETE FROM Students WHERE ID = 1;

Queries:
SELECT * FROM Students;
SELECT Name FROM Students WHERE Age > 16;
SELECT COUNT(*) FROM Students;

Join:
SELECT Students.Name, Courses.Title
FROM Students
JOIN Enrollments ON Students.ID = Enrollments.StudentID
JOIN Courses ON Enrollments.CourseID = Courses.ID;

🧹 8. Normalization (1NF, 2NF, 3NF)


Normal Form Key Concept
1NF No repeating groups; atomic values only
2NF 1NF + remove partial dependency on composite keys
3NF 2NF + remove transitive dependency (non-key depends on another non-key)

Reduces data redundancy and increases data integrity.

🧠 9. Key Vocabulary
Term Meaning
Primary Key Unique field per record
Foreign Key Field that references a primary key
Composite Key Multiple fields acting as a PK
Schema Database structure definition
Data Dictionary Metadata repository
ACID Atomicity, Consistency, Isolation, Durability
DBMS Software managing databases
Concurrency Safe multi-user data access
Data Integrity Accurate, valid data
Transaction Executed as a single logical unit
–2– 8820 – 7015

Option A — Databases

1. The Driving Licensing Agency stores information about individuals who hold a driving license
and/or own vehicles.

The following rules apply:


y Each individual may only hold one driving license.
y Each individual may own more than one vehicle.
y Each vehicle may be owned by one individual only.

(a) Construct the entity-relationship diagram (ERD) that shows the relationship between
the individual, their driving license, and their vehicle(s). [2]

When an individual applies for a driving license, they have to complete a license application form.
The following is an extract from that form:

Figure 1: Extract from driving license application form

Surname

First name(s)

Mr Mrs Miss Ms

Other title Male Female


Day Month Year
Date of birth

(b) Explain why Date of birth has been separated into three fields. [3]

The data in the form shown above is stored in the Person table. The license application form
also requires an individual’s medical information. This is stored in a table called PersonMedical.

The following extract is a sample of the medical questions that are asked.

Figure 2: A sample of the medical questions asked on the license application form

Have you ever had any of the


following conditions? No Yes

If you have answered “Yes”, please tick all the appropriates boxes.

Epilepsy
Fits or blackouts
Repeated attacks of sudden disabling giddiness
Diabetes controlled by insulin

(Option A continues on the following page)


–3– 8820 – 7015

(Option A, question 1 continued)

(c) Explain two reasons why medical information should not be stored in the Person table. [6]

(d) Outline two issues caused by storing redundant data. [4]

(e) Outline two situations where data stored by the Driving Licensing Agency may need to
be open to interrogation by other parties. [4]

2. Billetmania is an online company that sells tickets for theatre performances and music concerts.
After a customer has chosen their seats, they can pay for the tickets through a secure online
payment system. Once the transaction has been completed, the customer receives an
email receipt.

(a) Define the term database transaction.[1]

An information system and a database are used for Billetmania’s day-to-day operations.

(b) Outline how the Billetmania information system would utilize a database. [2]

(c) Explain the importance of transaction durability to Billetmania when clients book tickets. [3]

(d) Explain how the Billetmania database management system ensures that a seat is not
booked by two people simultaneously. [4]

(Option A continues on the following page)

Turn over
–4– 8820 – 7015

(Option A continued)

3. WineForAll is a retailer that sells wine in its stores. Each store sells wine from a number
of vineyards.

The following extract from the Wine file contains unnormalized data.

NameOfWine Vineyard Description UnitPrice Region StoreID StockQty

2015, Dry,
Chardonnay Stormy Bay $19.99 Gisborne 1 45
13 %

Sauvignon 2017, Dry,


Stormy Bay $29.99 Gisborne 2 20
Blanc 12 %

Sauvignon 2017, Dry,


Stormy Bay $29.99 Gisborne 1 45
Blanc 12 %

2016, Brut,
Pelorus Stormy Bay $34.99 Gisborne 1 10
14 %

Pecan 2016, Fruity,


Pinot Noir $29.99 Gisborne 3 32
Block 14 %

Sauvignon Pecan 2017,


$29.99 Gisborne 4 25
Blanc Block Dry,13 %

2013, Fruity,
Shiraz James Tree $25.99 Hawkes Bay 3 15
13.5 %

2013, Fruity,
Shiraz James Tree $25.99 Hawkes Bay 2 40
13.5 %

2014, Fruity,
Merlot James Tree $29.99 Hawkes Bay 1 25
14 %

Sauvignon 2016, Dry,


John Glad $19.99 Gladstone 4 30
Blanc 12.5 %

2017, Dry,
Chardonnay John Glad $15.99 Gladstone 2 28
13.5 %

(Option A continues on the following page)


–5– 8820 – 7015

(Option A, question 3 continued)

(a) Define the term record.[1]

(b) Identify the steps to create a query to find the vineyards and names of fruity wines
where the quantity in stock is between 25 and 35 bottles. [3]

(c) (i) Identify the steps to create a non-persistent derived field called TotalPrice,
which would hold the total value of wine stored for each record. [2]

(ii) Outline why the inclusion of a derived field will not affect the normalization of
a database. [2]

(d) Construct the 3rd Normal Form (3NF) of the unnormalized Wine file. [6]

(e) Outline why a single-field primary key is not always an appropriate solution for
normalized databases.  [2]

End of Option A

Turn over

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy