A3.2 Database design questions for IB Computer Science

91 questions on Database design, written by Augment in the style of IB exam papers. Six of them are below in full, to answer on paper.

  • IB Computer Science
  • Part of A3 Databases
  • SL and HL

Questions by paper and level

SL and HL questions are for students at either level. HL only questions cover what only HL students study.

PaperSL and HLHL onlyAll
Paper 185489
Paper 2202
Every paper87491

Counted on

Questions to try

Written by Augment in the style of IB exams, not past papers. Answer them on paper, then check each one against its markscheme with a free account.

Question 1 · CS-00035Paper 1 · 5 marks

A secondary school records the grade each student achieves in each course. Students who fail a course may retake it in a later term. Sample data from the Result table is shown.

StudentID

CourseCode

Term

Grade

S2231

CHEM1

2025-T1

3

S2231

CHEM1

2025-T3

5

S2231

HIST2

2025-T1

6

S2304

CHEM1

2025-T1

4

S2304

HIST2

2025-T3

7

  1. (a)

    Explain why StudentID cannot be the primary key of the Result table on its own.

    2 marks

  2. (b)

    Identify a suitable composite primary key for the Result table and justify your choice.

    3 marks

Question 2 · CS-01020Paper 2 · 7 marks

A dog-grooming salon is designing a database to store details of dogs, their owners and their grooming appointments. The owner of the salon has written out some sample records by hand. Several owners have more than one dog, and their names, phone numbers and addresses appear again in every one of their dogs' records.

  1. (a)

    Explain how abstraction is used when deciding which attributes to store for each dog.

    3 marks

  2. (b)

    Outline how decomposition helps when designing the database.

    2 marks

  3. (c)

    Outline how recognising the pattern in the sample records leads to a better design.

    2 marks

Question 3 · CS-00042Paper 1 · 12 marks

A hospital stores admissions in a relational database. Sample data from three tables is shown.

Patient

PatientID

Surname

DateOfBirth

70412

Baptiste

1958-03-11

70988

Kowalski

2001-09-27

71035

Osei

1990-12-02

Ward

WardCode

WardName

Floor

CAR

Cardiology

3

ORT

Orthopaedics

2

Admission

PatientID

AdmitDate

WardCode

Consultant

70412

2026-02-03

CAR

Dr Iyer

70988

2026-02-03

ORT

Dr Moreau

70412

2026-04-19

ORT

Dr Moreau

71035

2026-05-07

CAR

Dr Iyer

The primary key of Admission is the composite key (PatientID, AdmitDate).

  1. (a)

    Define the term composite key.

    1 mark

  2. (b)

    Identify the two foreign keys in the Admission table.

    2 marks

  3. (c)

    Outline why (PatientID, AdmitDate) is a suitable primary key for the Admission table.

    2 marks

  4. (d)

    A clerk tries to add the record (72200, 2026-05-09, ICU, Dr Iyer) to the Admission table. There is no patient 72200 and no ward ICU.

    Explain how the relational database protects data integrity in this situation.

    3 marks

  5. (e)

    The hospital is considering keeping all admissions in one wide table that also stores each patient's surname and date of birth and each ward's name and floor in every admission record.

    Explain two disadvantages of this design compared with the current three tables.

    4 marks

Question 4 · CS-01518Paper 2 · 12 marks

A national blood service is designing a database to record donors, the blood donations they give, and requests for blood from hospitals. A patient can only safely receive blood from certain blood groups; for example, group O negative can be given to patients of every group.

  1. (a)

    Outline how abstraction is used when deciding what to store about each donor.

    2 marks

  2. (b)

    Describe how decomposition could be applied to designing the database.

    3 marks

  3. (c)

    Outline how recognising that compatibility between blood groups follows a fixed set of rules affects the design.

    2 marks

  4. (d)

    Identify two constraints on the database.

    2 marks

  5. (e)

    Explain why the problem specification for this database should be agreed with medical staff before it is built.

    3 marks

Question 5 · CS-00045Paper 1 · 5 marks

A bakery records customer orders in a single table, OrderLog.

OrderNo

OrderDate

CustName

CustAddress

Item

1041

2026-03-02

Hana Ito

4 Mill Lane

Sourdough

1042

2026-03-02

Raj Patel

18 Quay Road

Croissants

1043

2026-03-04

Hana Ito

4 Mill Lane

Rye loaf

1044

2026-03-05

Hana Ito

27 Elm Close

Sourdough

  1. (a)

    Identify one item of data that is stored more than once in OrderLog.

    1 mark

  2. (b)

    State the problem shown by order 1044.

    1 mark

  3. (c)

    Explain how storing customers in a separate table linked to the orders would reduce redundancy and keep the data consistent.

    3 marks

Question 6 · CS-00047Paper 1 · 12 marks

A national weather service runs 4800 automatic weather stations. Each station sends a reading every minute. Sample data from two tables is shown.

Station

StationID

Location

Elevation_m

WS0117

Harbour Point

12

WS0482

Ridge Pass

1460

Reading

StationID

ReadingTime

Temp_C

Rain_mm

WS0117

2026-07-14 09:00

18.2

0.0

WS0482

2026-07-14 09:00

6.9

0.4

WS0117

2026-07-14 09:01

18.3

0.0

WS0482

2026-07-14 09:01

6.8

0.6

  1. (a)

    Identify a composite key that could be the primary key of the Reading table.

    1 mark

  2. (b)

    Explain why ReadingTime on its own would not be a suitable primary key.

    2 marks

  3. (c)

    Outline the relationship between the Station and Reading tables.

    2 marks

  4. (d)

    Explain one "big data" scalability issue that the weather service may face with a relational database.

    3 marks

  5. (e)

    Discuss whether a relational database is a suitable choice for the weather service.

    4 marks

Practice all 91 in Augment

Free with an account. Every question has its markscheme, and Augment keeps the ones you got wrong so you can come back to them.

The notes on A3.2 Database design

More questions in Databases

  1. A3.1Database fundamentals
  2. A3.2Database designThis page
  3. A3.3Database programming
  4. A3.4Alternative databases and data warehousesHL only

Check your answers in Augment

A free account opens all 91 questions on Database design with their markschemes, and keeps a record of what you have marked.