aimnova.
DashboardMy LearningPaper MasteryStudy Plan

Aimnova site navigation

Stay in the loop

Get the latest study resources and updates

New features, study tips and exam insights — straight to your inbox.

IB Diploma

  • IB Past Papers
  • IB Study Notes
  • IB Question Bank
  • IB Mock Exams
  • IB Revision

IB Subjects

  • IB Math AA
  • IB Math AI
  • IB Economics
  • IB Business Management
  • IB Physics
  • IB Biology
  • View all IB subjects→

IB Past Papers

  • IB Math AA HL Past Papers
  • IB Math AA SL Past Papers
  • IB Math AI HL Past Papers
  • IB Math AI SL Past Papers
  • IB Economics HL Past Papers
  • IB Economics SL Past Papers
  • IB ESS Past Papers
  • View all past papers→

Study Resources

  • Study Notes
  • Question Bank
  • Mock Exams
  • Flashcards
  • Revision Guide
  • Exam Skills
  • Command Terms
  • Grade Calculator
  • Exam Timetable 2026

Aimnova

  • Features
  • Pricing
  • For Schools
  • For Parents
  • About Us
  • Blog
  • Contact
aimnova.

AI-powered study platform for smarter revision, past-paper analysis and examiner-style feedback.

TermsPrivacyCookies·© 2026 Aimnova. All rights reserved.8afc4e3

Aimnova is not affiliated with or endorsed by the International Baccalaureate Organization (IB).

NotesComputer Science HLTopic 3.3
Unit 3 · Databases · Topic 3.3

IB Computer Science HL — Database programming

Database programming

Higher Level students should use this topic hub as a map: start with the shared sub-topics, then follow the HL-only extensions and exam-skill links where this topic asks for deeper analysis.

Exam technique guidePractice questions

Key concepts in Database programming

Key Idea: SQL does two different jobs: it defines the containers, and it works on what is in them. Ask of any statement: does it change the shape of the database, or its contents?

Paper 1

  • Definitions, keys, normal forms.
  • Identify the dependency; state the form broken.

Paper 2

  • A scenario to design or normalise.
  • Construct an ERD, tables, or SQL.

Both

  • Name the dependency, not just the normal form.
  • Every design choice needs a justification.

🏗️ The two sublanguages

DDL — definitionDML — manipulation
ChangesThe shapeThe contents
StatementsCREATE TABLE, ALTER TABLE, DROP TABLESELECT, INSERT, UPDATE, DELETE
ExampleAdding a columnAdding a row
Important: DROP TABLE removes the table's definition and every row — the table stops existing. DELETE FROM removes rows and leaves the empty table, its columns and its constraints standing.

🔍 Building a query

ClauseWhat it does
SELECTWhich columns
FROM / JOINWhich tables
WHEREFilters rows, before grouping
GROUP BYCombines rows into groups
HAVINGFilters groups, after grouping
ORDER BYSorts the result
WHERE is applied to individual rows before grouping, so it can only test values that exist in a row. HAVING is applied to the groups after, so it is the only one that can test an aggregate such as a count.

Joins

  • A join matches rows from two tables on a shared column — usually a foreign key to a primary key
  • INNER JOIN keeps only rows matching on both sides; unmatched rows vanish silently
  • LEFT JOIN keeps every row of the left table, filling the rest with nulls
  • Use a LEFT JOIN when the unmatched rows are part of the answer — a class with no students
  • Omitting the ON condition gives every possible pairing: a Cartesian product

💳 Transactions

Why they exist

  • A transaction is a group of statements treated as one indivisible unit — all, or none
  • COMMIT makes them permanent; ROLLBACK undoes them all
  • A bank transfer is two updates; a failure between them would destroy money
  • Uncommitted changes are invisible to others, because they may still be rolled back

📝 Exam-style questions

IB-style questionConstruct[4 marks]

Tables are Member(MemberID, name, joined) and Loan(LoanID, MemberID, bookTitle, returned). Construct SQL listing every member's name with how many loans they have, including members with none, most loans first.

🔒 Model answer plan

See the mark-by-mark plan — for / against / judgement, with marking guidance — in study mode.

Claim your free topic →
IB-style questionExplain[3 marks]

A clerk runs UPDATE Member SET name = 'Smith' with no WHERE clause. Explain what happens and why nothing warns them.

🔒 Model answer plan

See the mark-by-mark plan — for / against / judgement, with marking guidance — in study mode.

Claim your free topic →

✅ Quick check

Cover the answers.

Which clause filters GROUPS rather than rows? HAVING. WHERE filters rows before grouping and cannot test an aggregate.

What does omitting the ON condition from a join produce? A Cartesian product — every row paired with every row. It succeeds, which is what makes it dangerous.

DROP TABLE or DELETE FROM — which leaves the table standing? DELETE FROM. DROP removes the structure as well.

Why is COUNT(*) wrong after a LEFT JOIN? It counts the null row an unmatched record produces, giving 1 instead of 0.

What makes a bank transfer safe? Wrapping both updates in a transaction: all or nothing, so money cannot vanish between them.


Exam tips

  • Write the clauses in order: SELECT, FROM, JOIN, WHERE, GROUP BY, HAVING, ORDER BY.
  • Qualify every column with its table in a join — an ambiguous name is rejected.
  • LEFT JOIN when the unmatched rows are part of the answer; COUNT a column, not a star.
  • A condition on a count needs HAVING, never WHERE.
  • UPDATE and DELETE without WHERE affect EVERY row and report success. SELECT first.
  • A transaction is all-or-nothing — that is what makes a two-step transfer safe.

What you'll learn in Topic 3.3

  • 3.3.1 SQL language types
  • 3.3.2 Joining two tables
  • 3.3.3 Updating data with SQL
  • 3.3.4 SQL aggregate functions
  • 3.3.5 Database views
  • 3.3.6 Transactions and integrity
Suggested study order: Read the notes for each sub-topic below → test yourself with flashcards → attempt practice questions → review exam technique.

Study resources — 3.3 Database programming

3.3.1

SQL language types

Notes
3.3.2

Joining two tables

Notes
3.3.3

Updating data with SQL

Notes
3.3.4

SQL aggregate functions

Notes
3.3.5

Database views

Notes
3.3.6

Transactions and integrity

Notes

Ready to study Database programming?

Get expert practice questions with instant AI feedback, and a study planner tailored to your IB Computer Science HL exam date.

Start studying free

Topic 3.3 Database programming forms a core part of Unit 3: Databases in IB Computer Science HL. Mastering these concepts will strengthen your understanding of connected topics across the syllabus and prepare you for exam questions that require analysis, evaluation, and real-world application.

Previous topic
3.2 Database design
Next topic
3.4 Alternative databases
All Computer Science HL topics
Exam technique

Ready to practice?

Get AI-graded practice questions, mock exams, flashcards, and a personalised study plan — all aligned to your IB syllabus.

Start Studying Free

No credit card required · No time limit