Full Marks

A-level Computer Science Year 13 · Topic 7

Databases, big data and functional programming

Databases, big data and functional programming covers advanced data handling and a different style of programming.

We will design normalised relational databases, model entities, and keep data safe with transactions, locking and keys.

Then we look at client server databases, big data, and functional programming with higher order functions, composition and partial application.

In this topic

  1. 7.1Databases, normalisation and SQLFree below · 28 questions
  2. 7.2Big data and functional programmingOpen in Full Marks · 27 questions
  3. 7.3Entity-relationship modelling and relational database conceptsOpen in Full Marks · 35 questions
  4. 7.4Transaction processing, ACID, record locking and redundancyOpen in Full Marks · 36 questions
  5. 7.5Indexing, primary, secondary and foreign keys, and referential integrityOpen in Full Marks · 23 questions
  6. 7.6Client-server databasesOpen in Full Marks · 30 questions
  7. 7.7Higher-order functions: map, filter and fold, and list processingOpen in Full Marks · 14 questions
  8. 7.8Function composition, partial application and first-class functionsOpen in Full Marks · 24 questions

7.1 · Free notes

Databases, normalisation and SQL

Diagram: Databases, normalisation and SQL

Key points

In more detail

Practice

Databases, normalisation and SQL: 10 questions

Pick an answer to check it, or open the answer for the explanation.

1. What does first normal form (1NF) require?

  1. No transitive dependencies
  2. Atomic values with no repeating groups
  3. No partial dependencies
  4. Two primary keys
Show answer

B: Atomic values with no repeating groups. Each field holds a single value.

2. What does 3NF remove?

  1. Repeating groups
  2. Partial dependencies
  3. Transitive dependencies
  4. All relationships
Show answer

C: Transitive dependencies. Non-key fields must not depend on other non-key fields.

3. How is a many-to-many relationship usually implemented?

  1. With a single table
  2. Using a link (junction) table
  3. By removing keys
  4. It cannot be implemented
Show answer

B: Using a link (junction) table. The link table holds foreign keys to both tables.

4. What does the 'A' in ACID stand for?

  1. Access
  2. Atomicity
  3. Availability
  4. Accuracy
Show answer

B: Atomicity. A transaction completes fully or not at all.

5. What does referential integrity ensure?

  1. All fields are indexed
  2. A foreign key always refers to an existing record
  3. Tables are normalised
  4. Queries run faster
Show answer

B: A foreign key always refers to an existing record. It prevents orphaned records.

6. What does 2NF remove?

  1. Repeating groups
  2. Partial dependencies on part of a composite key
  3. Transitive dependencies
  4. All keys
Show answer

B: Partial dependencies on part of a composite key. 1NF handles repeating groups; 3NF handles transitive dependencies.

7. What does a JOIN do in SQL?

  1. Deletes tables
  2. Combines rows from two or more tables using related columns
  3. Sorts results
  4. Creates an index
Show answer

B: Combines rows from two or more tables using related columns. It relies on primary and foreign keys.

8. What is record locking used for?

  1. Encrypting records
  2. Preventing conflicting simultaneous updates to the same record
  3. Deleting duplicates
  4. Sorting records
Show answer

B: Preventing conflicting simultaneous updates to the same record. It supports the isolation property of transactions.

9. Table OrderLine(OrderID, ProductID, ProductName, Qty) has key (OrderID, ProductID). ProductName depends only on ProductID. Which form is broken?

  1. Boyce-Codd only, 1NF is fine
  2. 3NF
  3. 2NF
  4. 1NF
Show answer

C: 2NF. ProductName depends on part of a composite key, which is a partial dependency. This breaks 2NF. 3NF concerns dependencies between non-key attributes.

10. Student(StudentID, Name, TutorID, TutorName): TutorName depends on TutorID, not StudentID. What does this violate?

  1. 1NF
  2. 2NF as the key is composite
  3. 3NF as it is a transitive dependency
  4. Referential integrity
Show answer

C: 3NF as it is a transitive dependency. StudentID determines TutorID, which determines TutorName: a transitive dependency, so 3NF is broken. 2NF is not relevant as the key is a single field.

Keep going in Full Marks

Full Marks has 28 questions on Databases, normalisation and SQL (18 more than here), set out in practice levels. You also get notes and 3D models for all 8 subtopics of Databases, big data and functional programming, plus games, timed exams and past papers.

On your exam board

Not in the Cambridge specification.

All A-level Computer Science Year 13 topics