Consider the relational schema Class, used in a university database: Class…

2025

Consider the relational schema Class, used in a university database:

Class (course id, title, dept name, credits, sec id, semester, year, building, room number, capacity, time slot id)

The set of functional dependencies that we require to hold on Class are:

  • course id → title, dept name, credits

  • building, room number → capacity

  • course id, sec id, semester, year → building, room number, time slot id

A candidate key for this schema is {course id, sec id, semester, year}.

Considering only the above conditions, which of the following functional dependencies definitely holds on Class?

  1. A.

    course id → title, dept name, credits

  2. B.

    title → dept name, credits

  3. C.

    dept name → credits

  4. D.

    Cannot be determined

Attempted by 13 students.

Show answer & explanation

Correct answer: A

Concept

A functional dependency X → Y "holds" on a relation only if it is given directly, or if it can be derived from the given set using Armstrong's axioms (reflexivity, augmentation, transitivity, and the derived rules of union, decomposition, pseudotransitivity). The standard tool to test this is the attribute-closure computation: for a set of attributes X, X⁺ is the set of every attribute functionally determined by X using the given dependencies. A dependency X → Y holds if and only if every attribute of Y is contained in X⁺.

Application

Compute the closure of the left-hand side offered in each option, using only the three given dependencies:

  1. {course id}⁺: the first given dependency, course id → title, dept name, credits, applies directly, so {course id}⁺ = {course id, title, dept name, credits}. No other dependency has course id alone on its left side, so the closure stops here.

  2. {title}⁺: none of the three given dependencies has title (alone) on the left-hand side, so nothing can be added — {title}⁺ = {title}.

  3. {dept name}⁺: likewise, no dependency has dept name on the left-hand side, so {dept name}⁺ = {dept name}.

Since {title, dept name, credits} ⊆ {course id}⁺, the dependency course id → title, dept name, credits holds — this needs no derivation at all, since it is exactly the first given dependency itself. Since dept name and credits are not in {title}⁺, title → dept name, credits does not hold. Since credits is not in {dept name}⁺, dept name → credits does not hold either.

Cross-check

Because one of the offered relations is positively confirmed by the closure computation, the situation is not indeterminate — a concrete yes/no answer is available directly from the given dependency set, so "cannot be determined" is ruled out.

Explore the full course: Computer Science

Loading lesson…