Home › Theme A › A3 › A3.1 › A3.1.1

A3.1.1 Relational databases: features, benefits and limits

SL + HLCommand term: Explain

1. Tour of the school library database

A library keeps track of students, books, loans and reservations. Click Next to discover the features of a relational database one by one.

2. Why do people love relational databases?

Three mini-labs: (a) reduced redundancy and consistency, (b) integrity rules, (c) concurrency control.

(a) One fact, one place

Wei Chen has borrowed books and changes the name they use. Compare a spreadsheet (name copied on every row) with the database (name stored once, loans refer to the ID).

📄 Spreadsheet (flat file)
🗄️ Database (joined view)
Loans per student:

(b) The database says no (data integrity)

Try to break the data. Rules (primary keys, foreign keys, data types) protect it. The Students table has S1–S4, Books B1–B4; Wei (S1) has loans.

(c) Two librarians, one last copy (concurrency control)

Only 1 copy of "Logic Puzzles" is left. Librarian A and Librarian B both try to lend it at the same moment.

3. Where relational databases struggle

Pick a limitation and try the demo.

4. Flip-card deck

Click a card to flip it. Try saying the explanation before you flip!

5. Feature, benefit or limitation?

Ten statements. Classify each one. Streaks of 3+ score double.

Round 0/10Score 0Streak 0Best 0
Press start!

6. 45-second speed round

Which feature solves the problem? Answer as many as you can before time runs out.

45sScore 0Streak 0Best 0
Press start!

Learning objectives

By the end of this page you should be able to:

  1. Describe the features of a relational database: tables, primary keys, foreign keys, composite keys and relationships.
  2. Explain the benefits of relational databases, including data integrity, data consistency and reduced redundancy.
  3. Explain further benefits, including concurrency control, reliable transaction processing, scalability and security.
  4. Explain the limitations of relational databases, such as rigid schemas and handling unstructured or hierarchical data.
  5. Explain further limitations: big-data scalability, design complexity and object-relational impedance mismatch.

Features

  • A relational database stores data in tables (also called relations). Each table is about one kind of thing (an entity, e.g. Student). A row (record / tuple) is one instance and a column (field / attribute) is one property with a fixed data type.
  • A primary key (PK) is a field that uniquely identifies each record; it cannot be duplicated or NULL.
  • A composite key is a primary key made from two or more fields together (e.g. StudentID + BookID). Neither field alone has to be unique.
  • A foreign key (FK) is a field in one table that holds the primary-key value of a record in another table. It links the tables and is used to enforce referential integrity.
  • Relationships connect tables: one-to-one, one-to-many (one student, many loans) and many-to-many (students books, solved with a linking table such as Loans).

Benefits

  • Reduced redundancy / duplication: each fact is stored once, other tables refer to it with a key. Saves storage and avoids repeated typing.
  • Data consistency: with one copy, an update is seen everywhere, so there are no conflicting versions.
  • Data integrity: rules (PK uniqueness, FK existence, data types, constraints) make sure data is valid and accurate (no loan for a student who does not exist).
  • Data retrieval: SQL, indexes and joins let you ask flexible questions and get fast, accurate results.
  • Concurrency control: many users can read and write at the same time without corrupting each other's work (locking, transactions).
  • Reliable transaction processing: a transaction is all-or-nothing (ACID: atomic, consistent, isolated, durable), so a crash cannot leave half a bank transfer.
  • Security features: user accounts, access rights per table / view / column, encryption, auditing and backups.
  • Scalability: can grow to large numbers of records and users (bigger servers, indexes, replication, partitioning).
  • Community support: mature technology with a standard language (SQL), many free systems (MySQL, PostgreSQL, SQLite), documentation, tools and skilled people.

Limitations

  • Scalability for “big data”: scaling up one server is costly; spreading joins and transactions over many servers is hard, so huge volumes or very high write rates can be a problem.
  • Design complexity: good design needs entities, keys, relationships and normalisation; poor design causes anomalies, and many tables mean complex joins.
  • Hierarchical data: trees (folders, organisation charts) need self-joins or recursive queries, which are awkward and slower.
  • Rigid schema: every record in a table has the same fields and types; changing the structure affects all rows and the programs that use them.
  • Object-relational impedance mismatch: programs use objects with nested data and inheritance; the database uses flat tables, so code must convert (map) between them.
  • Unstructured data: images, video, free text, documents and varied JSON do not fit neatly in rows and columns and cannot easily be queried inside.

Writing an “Explain” answer

“Explain” needs a point + reason + link to the context. Not just “it reduces redundancy”, but “data is stored once and referenced by a foreign key so a change to a student's name is made in one place and every loan shows the same name”.

Use the 中文 button at the top to show or hide the Chinese terms.

Term中文Meaning

Choose an answer. You get instant feedback.

Score: 0 /

Write your answer first, then reveal the markscheme. These are exam-style practice questions written for this site.

1. Outline the purpose of a primary key in a relational database. [2]

It uniquely identifies each record in a table [1]; so no two records are the same / values cannot be duplicated or null / records can be referred to by other tables [1].

2. Describe the role of a foreign key. [2]

A field in one table that holds the primary key value of a record in another table [1]; it creates the link / relationship between the tables and enforces referential integrity (cannot refer to a record that does not exist) [1].

3. A school keeps students' details in a spreadsheet, repeating the student name on every row of a book-loan list. Explain two benefits of moving to a relational database. [4]

Award [2] for each benefit explained (point [1] + development [1]), up to [4]. Reduced redundancy: student details stored once in a Students table and loans refer to the StudentID [1], saving storage / less data entry [1]. Data consistency: a change (e.g. name) is made in one place [1], so all loans show the same value / no conflicting copies [1]. Data integrity: foreign key / data type rules [1] prevent a loan for a student who does not exist / invalid data [1]. Concurrency control: several librarians can update at the same time [1] without lost updates or double-lending the last copy [1]. Security: access rights [1], so students can see but not change records [1]. Data retrieval: SQL queries / indexes [1] allow quick searching e.g. all books borrowed by a class [1].

4. Explain two limitations of using a relational database to store the posts, photos and video clips of a social-media app. [4]

Award [2] for each, up to [4]. Unstructured data: photos / videos / free text do not fit rows and columns with fixed types [1]; they are stored as large binary objects and their content cannot be searched with SQL [1]. Big-data scalability: very large numbers of posts and users [1]; scaling a relational database over many servers with joins and transactions is difficult / expensive [1]. Rigid schema: posts have varied fields / new features need new fields [1]; changing the table structure affects all records and the application [1]. Hierarchical data: threads of comments / replies form a tree [1]; needs complex self-joins or recursive queries [1]. Impedance mismatch: app objects must be converted to tables and back [1], adding code and slowing development [1].

5. Explain how a relational database supports concurrency and reliable transaction processing when two users update the same record. [4]

Records are locked / isolated while one user changes them [1]; the second user waits or sees the updated value [1], preventing lost updates / double booking [1]. A transaction is all-or-nothing (atomic) [1]; if there is a failure it is rolled back so data is not left half-updated [1]. (Max [4].)

6. An online retailer is choosing a database for customer orders, product catalogue and millions of customer-review photos. Discuss whether a relational database is suitable. [6]

Award marks for a balanced discussion that reaches a conclusion, up to [6]. Suitable for orders and catalogue [up to 3]: structured data in tables; primary / foreign keys link customers, orders, products; integrity and consistency for payments; transactions make an order all-or-nothing; concurrency control stops two customers buying the last item; SQL retrieval for reports; security for personal data; mature, widely supported. Less suitable for reviews / photos [up to 3]: images are unstructured and not queryable by SQL; very large volume and growth challenge scalability; rigid schema when review formats change. Conclusion e.g. use a relational database for orders and catalogue, with the photos held as files / object storage (or a different database type) referenced by the database [1].