Library › Computer Science 9618 › Databases
AS Level · Computer Science 9618

Databases

Revise Databases for Computer Science 9618 (AS Level) — revision notes and instant AI marking.

📖 Revision notes · preview
  Cambridge International AS & A Level Computer Science (9618)

Databases

The big idea: A relational database stores each fact once, in linked tables, and lets the DBMS keep it consistent and secure. Most marks come from three skills: using the key terminology precisely, normalising a design to 3NF, and writing correct SQL.

Summary — What This Chapter Covers
  • A file-based approach suffers from data redundancy, inconsistency, data dependence and poor security.
  • A relational database stores data in linked tables, which removes these problems.
  • Terminology: entity, table, record/tuple, field/attribute, primary, candidate, secondary and foreign keys, relationships, referential integrity, indexing.
  • E-R diagrams show entities and the one-to-one, one-to-many and many-to-many relationships between them.
  • Normalisation to 1NF, 2NF and 3NF removes repeating groups, partial dependencies and non-key dependencies.
  • A DBMS provides a data dictionary, data modelling, a logical schema, integrity and security, a developer interface and a query processor.
  • SQL is the standard DDL (CREATE DATABASE, CREATE TABLE, ALTER TABLE, keys) and DML (SELECT, INSERT, UPDATE, DELETE).
1. File-based Approach and the Relational Model
Database concepts

Why databases replaced separate files

In a file-based approach each department or program keeps its own files. Limitations:

  • Data redundancy: the same data (a customer’s address) is stored in several files, wasting storage.
  • Data inconsistency: when one copy is updated the others are not, so different files disagree.
  • Data dependence: programs are written for a specific file structure, so changing the structure means rewriting the programs.
  • Data is hard to share or combine between departments, and security cannot be managed centrally: anyone with the file sees all of it.

A relational database stores data in tables linked by keys. Each item is stored once (less redundancy, so no inconsistency); the structure is separate from the programs (data independence); data can be queried across tables; and the DBMS controls access and integrity centrally.

2. Relational Terminology
Database concepts

Use these words precisely

  • Entity: a thing about which data is stored (Customer, Product). Table (relation): data about one entity, in rows and columns.
  • Record / tuple: one row, data about one instance. Field / attribute: one column, one item of data.
  • Primary key: an attribute (or combination) that uniquely identifies each record. Candidate key: any attribute that could be the primary key; one is chosen. Secondary key: a non-key attribute that is indexed for fast searching or sorting (LastName). Foreign key: an attribute in one table that is the primary key of another table, creating the link.
  • Relationship: one-to-one, one-to-many or many-to-many. A many-to-many relationship cannot be implemented directly; it is replaced by a link table with two one-to-many relationships.
  • Referential integrity: every foreign key value must match an existing primary key value in the linked table. The DBMS will not let you add a sale for a customer who does not exist, or delete a customer who still has sales.
  • Indexing: a separate structure listing key values and where their records are, so searches and sorts are faster.
🔓 Read the full Databases note → You're seeing the preview · sign in to read it all
Also in the full note
  • Removing repeated and badly placed data
  • Features and tools
  • Creating and changing the structure
  • Querying and maintaining data
What's inside
📖 Revision notes 🎯 Learn mode ✦ AI flashcards ✓ Instant AI marking 🧊 3D explorers 🧪 Experiments & simulations 📈 Progress tracking
📄 Practise Databases with Computer Science 9618 past papers Every paper with its mark scheme — answer online, marked instantly. Open →

Read the full Databases notes free

That's the preview — create a free account to read the rest, plus flashcards and practice questions with instant AI marking. No credit card.

Unlock the full notes free →

More Computer Science topics