GratuitPréparation au MasterQCMStructurée

Master's Preparation – Database Systems – Practice Set

Examen
University degree preparation
Année
2026 · Practice
Niveau
Master entrance / M1
Durée
60 min
points
30

Source: Original Ngahtech practice set for Master's entrance preparation.

Answer all questions. Show your reasoning.

  1. Question 1QCM5 points

    A relation is in Third Normal Form (3NF) if it is in 2NF and:

    • A. it has no multivalued attributes
    • B. no non-key attribute depends transitively on the key
    • C. every determinant is a candidate key
    • D. it has a single-column primary key

    🤖 Demander au tuteur IA

    Voir la réponse et l'explication

    Bonne réponse: B. no non-key attribute depends transitively on the key

    Explication

    3NF removes transitive dependencies of non-key attributes on the key. Option C describes BCNF.

  2. Question 2QCM5 points

    Which isolation anomaly occurs when a transaction reads data written by another transaction that later rolls back?

    • A. Phantom read
    • B. Dirty read
    • C. Lost update
    • D. Non-repeatable read

    🤖 Demander au tuteur IA

    Voir la réponse et l'explication

    Bonne réponse: B. Dirty read

    Explication

    Reading uncommitted data that is later rolled back is a dirty read.

  3. Question 3Structurée20 points

    Table ORDERS(order_id, customer_id, customer_name, customer_town, product_id, product_name, qty, unit_price).

    (a) List the functional dependencies and normalise the table to 3NF. [12]

    (b) Write an SQL query returning each town's total sales amount, highest first. [8]

    🤖 Demander au tuteur IA

    Voir la réponse et l'explication

    Barème

    (a) FDs: customer_id → name, town; product_id → product_name, unit_price; (order_id, product_id) → qty (4). Tables CUSTOMER, PRODUCT, ORDER, ORDER_LINE with correct keys (8).

    (b) Correct joins (3), SUM(qty × unit_price) (2), GROUP BY town (2), ORDER BY DESC (1).

    Corrigé type

    SELECT c.town, SUM(l.qty * p.unit_price) AS total
    FROM order_line l
    JOIN orders o ON o.order_id = l.order_id
    JOIN customer c ON c.customer_id = o.customer_id
    JOIN product p ON p.product_id = l.product_id
    GROUP BY c.town
    ORDER BY total DESC;