Skip to content
C

Simple Attribute


Simple Attribute

Definition

A simple attribute (also called an atomic attribute) is an attribute that cannot be meaningfully divided into smaller sub-parts. It is a single, indivisible unit of data. Simple attributes are the "leaf nodes" of the attribute hierarchy — they contrast directly with composite attributes (6.7), which can be broken into meaningful sub-attributes.

Worked Example

In the Student entity set, Roll_No is a simple attribute — "21CS045" has no smaller sub-parts that are individually meaningful for the database's purposes. Similarly, CGPA (e.g., 8.75) and Gender are simple attributes. Contrast this with Address, which is composite: it naturally decomposes into Street, City, State, and Pincode, each of which is independently useful (e.g., for filtering "all students from Mumbai").

Edge Cases

  • Whether an attribute is "simple" or "composite" is a design decision based on need, not an absolute property of the real-world data. A Name could be treated as simple ("Aditi Sharma" as one string) or composite (FirstName + LastName), depending on whether the application ever needs to query or sort by the sub-parts separately.
  • A simple attribute is always, by definition, also single-valued in terms of structure (it has no sub-attributes) — but note this is a different axis from single-valued vs. multi-valued (6.8/6.9), which is about whether an entity can have one occurrence or many occurrences of that attribute. Phone_Number can be a simple attribute (indivisible as a unit) that is ALSO multi-valued (a student can have more than one phone number).
  • Do not assume "simple" means "cannot be a string" — simplicity refers to structural decomposability, not data type or length.

Key Takeaways / Interview Q&A

Q: What is the single test to decide if an attribute is simple? A: Ask: "Does the database ever need to reference or query a sub-part of this attribute independently?" If no meaningful sub-parts are ever needed, it is simple.

Q: Is `Email` a simple attribute? A: Typically yes — even though an email address technically has a "local part" and a "domain," most applications never need to query these separately, so it is modeled as simple.

Q: Can a simple attribute be part of a composite attribute? A: Yes — a composite attribute is built entirely FROM simple attributes as its immediate components (e.g., Address is composite, made of the simple attributes Street, City, State, Pincode).

Mock Test

  • Simple Attribute - Quick Test

    8 questions on Simple Attribute.

    8 questions · 8 min · Medium
    Start Mock Test