levo

Fundamentals of Databases

Database design and normalisation techniques

  • 3 things to know
  • Paper 2

Overview

Recall questions on why databases are normalised, the conditions for first, second and third normal form, functional dependency, and normalising a given table.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

What must be true for a relation to be in second normal form?

Key term

State the properties possessed by a relation in third normal form.

Key term

A magazine order database is normalised to third normal form. Which four relations result?

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    What is normalisation?

    Model answer

    Normalisation is the process of organising the attributes of a database into tables so that each item of data is stored once, in the table where it belongs, and so that the structure supports the required queries without redundancy. It is carried out in stages, each removing a particular kind of dependency, and it proceeds by splitting tables and introducing keys until the relations satisfy the conditions of the normal form being aimed at, which at this level is third normal form.

  2. 2

    Understand why databases are normalised. Give the reasons.

    Model answer

    To remove redundancy, so that no item of data is stored more than once. This saves storage, but far more importantly it removes the possibility of the copies disagreeing, so the data stays consistent. It removes update anomalies, where changing a value means altering many rows and missing one leaves the database contradicting itself. It removes insertion anomalies, where a fact cannot be recorded because some unrelated data is not yet known. It removes deletion anomalies, where deleting one record accidentally destroys the only copy of an unrelated fact. Updates are also faster, because one row is written rather than many, and the resulting structure is more flexible: new queries and new tables can usually be added without restructuring what is already there.

  3. 3

    A single table holds StudentID, StudentName, TutorID, TutorName and TutorRoom, with one row per student. Identify the update, insertion and deletion anomalies it suffers.

    Model answer

    Update anomaly: a tutor's room is repeated in the row of every student they tutor, so a room change means editing many rows, and any row missed leaves two different rooms recorded for the same tutor. Insertion anomaly: a newly appointed tutor cannot be recorded at all until they have at least one student, because there is no row to put them in without a StudentID. Deletion anomaly: if a tutor's last student leaves and that row is deleted, all record of the tutor, their name and their room disappears with it. All three arise from the same cause — tutor data being stored in a table whose subject is students.

  4. 4

    What conditions must a relation satisfy to be in first normal form?

    Model answer

    It must contain no repeating groups, and every attribute value must be atomic — a single indivisible item in every cell. In practice this means no attribute holds a list, and no set of attributes such as Item1, Item2, Item3 repeats the same idea across several columns. Repeating groups are removed by taking them out into a separate relation, whose primary key includes the key of the original relation.

  5. 5

    What must be true for a relation to be in second normal form?

    Model answer

    It must already be in first normal form, and it must contain no partial dependencies — no non-key attribute may depend on only part of a composite primary key; every non-key attribute must depend on the whole of the primary key. The question only arises where the primary key is composite, because a single-attribute key has no parts, so a relation in first normal form with a single-attribute primary key is automatically in second normal form.

  6. 6

    What must be true for a relation to be in third normal form?

    Model answer

    It must already be in second normal form, and it must contain no transitive dependencies — no non-key attribute may depend on another non-key attribute. Every non-key attribute must be determined by the primary key directly, and not by way of some other ordinary attribute.

Other ways to work this

The same content, four other ways.

What is inside Levo

Six ways to work the same material.

1Closed book
2Open book
3Closed book

The 3-step method, run for you

Answer cold, learn it, then prove it stuck. Levo tracks the jump between your first attempt and your last.

Fundamentals of Programming
Fundamentals of Data Structures
Fundamentals of Algorithms
Theory of Computation

Cram a whole paper in one sitting

Sort every topic into what you know and what you do not, then drill only the weak ones.

A driver is .
softwarehardwarestorage

Blank Blitz makes facts automatic

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

AThe integer 5 is 0101.
B0.75 is 1/2 + 1/4.
CThe fraction bits are 1100.

Build It gets the exam shape right

Assemble a full-mark answer from its marking points, in the order an examiner wants them.

Head means the first single element of a non-empty list.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The traps are the mistakes students actually make.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Every question in Fundamentals of Databases, on a schedule.

Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.