Skip to content
Question 22 of 29

Q.Differentiate between the terms Attribute and Domain in the context of Relational Data Model.

Yanam BieapCBSE Class XII Board 2022Subjective· 2mImportance★★★★★
76% · 22/29 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

An attribute is a column (property) of a relation, while a domain is the set of permissible values that an attribute can take — the attribute is the name, the domain is the allowed data type and range.


The Core Idea

Think of a relation (table) as a spreadsheet of facts. Each column has a name — that's the attribute. But every column also has a type of data it can hold: numbers, text, dates, etc. That type, along with any constraints on the values, is the domain. The attribute is what we're storing; the domain is how we constrain what can be stored there. This is a core idea in CBSE Class 12 Computer Science relational database concepts.

For example, in a Student table, you might have an attribute called age. The domain of age could be "integers between 1 and 120". The attribute is the label; the domain is the rulebook for valid entries.


Step-by-Step Breakdown

  1. Attribute: The Column Name

    An attribute is a named column of a relation. It represents a property or characteristic of the entity described by the relation.

    • Example: In Student(roll_no, name, age), the attributes are roll_no, name, and age.
    • Each attribute has a unique name within the relation schema.
  2. Domain: The Set of Allowed Values

    A domain is a set of atomic (indivisible) values from which one or more attributes draw their actual values. It defines the data type, length, and any constraints.

    • Example: the domain of age could be all integers x such that 1 <= x <= 120.
    • Domains are often shared across attributes — e.g., both student_age and teacher_age might use the same domain of "positive integers up to 120".
  3. Key Difference: Name vs. Value Space

    The attribute is the label; the domain is the pool of legal values.

    • Two different attributes (e.g., age and years_of_experience) can share the same domain.
    • An attribute cannot exist without a domain — every attribute must be defined over some domain.
  4. Formal Definition in Relational Model

    In Codd's relational model:

    • A relation schema R(A1, A2, ..., An) has attributes A1 ... An.
    • Each attribute Ai is associated with a domain Di.
    • A tuple t in the relation assigns to each attribute Ai a value v such that v belongs to Di.
Tip

A neat way to remember: Attribute = column header, Domain = the "type" of that column (like INTEGER, VARCHAR(50), or a custom set like {'M','F'}). In SQL, the domain is essentially the data type plus any CHECK constraints.

  1. Example to Cement the Idea Consider a relation Employee(emp_id, salary, gender).
    • Attributes: emp_id, salary, gender.
    • Domains:
      • emp_id: domain = 6-digit positive integers. …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.