IAE Academy

GATE 2023 CS Q.16: solution and answer

GATE 2023 · CSQ.16 · 1 mark · MCQ

Which one of the options given below refers to the degree (or arity) of a relation in relational database systems?

  1. (A)

    Number of attributes of its relation schema.

  2. (B)

    Number of tuples stored in the relation.

  3. (C)

    Number of entries in the relation.

  4. (D)

    Number of distinct domains of its relation schema.

See the question in the paper

Answer and solution

ANSWER

The degree (arity) of a relation is the number of attributes in its relation schema, option (A).

Official answer: ASource: Official answer key, GATE 2023 CS (IIT Kanpur)

  1. The degree (arity) of a relation is the number of columns, which is the number of attributes in its relation schema.

  2. The number of tuples (rows) stored in a relation is its cardinality, not its degree. Option (B) describes cardinality.

  3. "Number of entries" is not a standard term for a relation. If it means cells, the count is degree cardinality, which is neither the degree nor the cardinality. Option (C) is wrong.

  4. Distinct domains do not give the degree. Two attributes can share one domain, for example two date columns, so the number of distinct domains can be smaller than the number of attributes. Option (D) is wrong.

  5. Hence the degree is the number of attributes of the relation schema, option (A).

KEY IDEA

Degree is the number of columns (attributes). Cardinality is the number of rows (tuples).

WATCH OUT FOR

Mixing up degree and cardinality, and picking the number of tuples (B) because it sounds like the size of the relation.

From the GATE 2023 CS paper. Every question of this paper · Download the full paper · All 13 Relational algebra questions, with notes

More Relational algebra questions