CertNote/ Commute Study Notes
Roadmap
KOEN
CLF-C02 · FoundationalCloud Practitioner - Foundational
DVA-C02 · AssociateDeveloper - Associate
SAA-C03 · AssociateSolutions Architect - Associate
SOA-C02 · AssociateCloudOps Engineer - Associate
SAP-C02 · ProfessionalSolutions Architect - Professional
DOP-C02 · ProfessionalDevOps Engineer - Professional
Linux Master 2 · 2급KAIT Linux Master - Level 2
SCS-C03 · SpecialtySecurity - Specialty
Linux Master 1 · 1급KAIT Linux Master - Level 1
MLA-C01 · AssociateMachine Learning Engineer - Associate
AIF-C01 · FoundationalAI Practitioner - Foundational
DEA-C01 · AssociateData Engineer - Associate
MLS-C01 · SpecialtyMachine Learning - Specialty
SQLD · 개발자SQL Developer (SQLD)
  • Week 1
    • 1.Data Modeling Overview
    • 2.Three-Level Schema and Modeling Stages
    • 3.Entities
    • 4.Attributes
    • 5.Relationships
  • Week 2
  • Week 3
  • Week 4
  • Week 5
  • Week 6
  • Week 7
  • Week 8

© CertNote · 주간랩스

  • About
  • Changelog
  • Contact
  • Terms
  • Privacy
← SQLD/Week 1/Day 4

Based on the SQLD exam syllabus·Report an error

SQLD· AssociateWeek 1 · Day 4~22 min read

Day 4 - Attributes

📌 Key Takeaways

  • An attribute is the smallest unit of data, no longer divisible in meaning, that the business needs. It describes an entity and makes up an instance.
  • An attribute holds only one attribute value per instance. If there are multiple values, split them out into a separate entity.
  • By nature, attributes are divided into basic, designed, and derived attributes; by how they compose an entity, into PK, FK, and regular attributes.
  • A derived attribute is a value computed from other attributes, so it easily harms consistency. Define as few as possible.
  • A domain is the range of values an attribute can take (type, size, constraints).

What Describes a Single Order?

To describe order O1001, you need the order number, order date, customer ID, shipping address, and payment amount. Each of these is an attribute. If an entity answers "what do we manage?", an attribute answers "what do we record about it?"

Definition

  • It is information the business needs.
  • It is the smallest unit of data that is no longer divisible in meaning.
  • It describes an entity and becomes a component of an instance.

The phrase "in meaning" is important. The order date 2026-11-03 can be split into year, month, and day as characters. But if the business uses the order date as a single meaning, it is one attribute that is not split.

Relationships Among Entities, Instances, Attributes, and Attribute Values

RelationshipRuleOnline store example
Entity - InstanceAn entity has two or more instancesThe Order entity has O1001, O1002 ...
Entity - AttributeAn entity has two or more attributesOrder number, order date, payment amount ...
Attribute - Attribute valueAn attribute has only one attribute value per instanceO1001 has exactly one payment amount: 35,000
                  Order No.  Order Date   Customer ID  Payment Amt  ← Attributes
  Instance 1 →    O1001      2026-11-03   C001         35,000
  Instance 2 →    O1002      2026-11-03   C002         12,000
                                                       ↑ Attribute value
  • The last rule is the atomic value principle. Only one value goes into a cell.
  • If a customer has three contact numbers (home, mobile, work), you don't put all three into a single contact cell. Either split contacts out into a separate entity, or, if their meanings differ, split them into three attributes. This judgment leads into first normal form (Week 2).

Classification by Nature

ClassificationMeaningOnline store example
Basic attributeAn attribute that originally exists, pulled directly from business analysis. The most commonProduct name, product price, order date, order quantity
Designed attributeAn attribute that does not originally exist in the business but was newly created during design. Codes and serial numbers fall hereOrder status code, order item serial number
Derived attributeAn attribute obtained by calculating or transforming other attributesOrder total (sum of quantity × unit price), customer cumulative purchase amount
  • Designed attributes are created "to express business rules simply." Defining "preparing for shipment, shipping, delivered" as codes 10, 20, 30 makes it a designed attribute.
  • Even if it looks like a basic attribute, if it was redefined as a code or assigned by the system like a serial number, it is treated as a designed attribute.

Why Be Careful with Derived Attributes

[Order Item]
  Order No.  Product   Qty  Unit Price
  O1001      Pen       2    1,000
  O1001      Notebook  1    3,000
                 │  2 × 1,000 + 1 × 3,000
                 ▼
[Order]
  Order No.  Order Total (derived)
  O1001      5,000
  • The order total is the sum of quantity × unit price from the order items. If you change an order item's quantity to 3 without also updating the order total, the two values no longer match.
  • That is why derived attributes easily harm data integrity. Define them only when truly necessary, and once defined, set up rules so they are updated whenever the source attributes change.
  • Deliberately keeping a derived attribute for query performance is a form of denormalization.

⚠️ The principle is to define derived attributes "as few as possible." An answer choice saying "define as many as possible for performance" is a wrong statement. The more computed values you store, the more places there are where you can forget to update.

Classification by How They Compose an Entity

ClassificationMeaningOrder entity example
PK attribute (Primary Key)An attribute that can identify an entity's instancesOrder number
FK attribute (Foreign Key)An attribute included because of a relationship with another entityCustomer ID (comes from the Customer entity)
Regular attributeAll the remaining attributes that are neither PK nor FKOrder date, shipping address, payment amount
  • The same customer ID is a PK attribute in the Customer entity and an FK attribute in the Order entity. The classification depends on which entity you are looking at it from.
  • The detailed classification of PKs, FKs, and identifiers is covered in Week 2 Day 1.

Classification by Composition and Number of Values

Depending on the textbook, this classification is explained along two axes. The names are similar, so we organize them together.

CriterionClassificationMeaningOnline store example
Can it be split?Simple (single) attributeCannot be divided into smaller unitsOrder quantity, product price
Composite attributeCan be divided into multiple units of meaningAddress (city, district, neighborhood, detailed address), customer name (first name, last name)
How many values?Single-valued attributeOne value per instanceDate of birth
Multi-valued attributeMay have multiple values per instanceA customer's multiple shipping addresses, a product's multiple colors
  • Whether to split a composite attribute is decided by whether the business uses that part separately. If you produce shipping statistics by district, you split the address into city, district, and neighborhood.
  • Since you can't put multiple values into one cell, a multi-valued attribute is split off into a separate entity in the relational model. A customer's multiple shipping addresses become a "Customer Shipping Address" entity.
  • Some textbooks bundle these in a single line as "single attribute / composite attribute / multi-valued attribute." More than the terms, the criteria for judgment are distinguishing "can it be split?" from "are there multiple values?"

Domain

A domain is the range of values each attribute can take.

AttributeDomain example
Order quantityAn integer from 1 to 999
Order status codeOne of 10, 20, 30, 40
Customer nameA string of up to 50 characters, NULL not allowed
Order dateDate type
  • A domain includes the data type, size, and constraints together.
  • In a physical model, it is implemented as the column's type (NUMBER, VARCHAR2(50)) and CHECK and NOT NULL constraints.
  • Multiple attributes can share the same domain. Order date, shipping date, and payment date all use the "date" domain. Defining a domain once prevents the problem of types differing from attribute to attribute.

Naming Attributes

PrincipleGood exampleBad example
Names used in the businessPaymentAmountPayAmtVal
Don't use descriptive namesOrderDateTheDateTheCustomerOrdered
Limit abbreviationsShippingAddressShAddr
Unique names across the whole model recommendedOrderDate, ShipDateDate, Date
  • Attribute names are written as noun forms. Avoid descriptive forms with modifiers or possessives attached.
  • Unique names are "recommended." If different entities have the same name Date, it becomes confusing which is which in SQL join results, and they also collide when columns are merged through denormalization.

Tomorrow we'll look at relationships that connect entities, and their notations.

📖 Glossary

  • Attribute : A unit of data that describes an entity and cannot be divided further in meaning. A candidate for a table column.
  • Attribute value : The actual value an attribute holds in one instance. Only one goes in a cell.
  • Designed attribute : An attribute that doesn't originally exist in the business but is newly created during design, like a code or serial number.
  • Derived attribute : An attribute obtained by calculating or transforming other attributes. Things like sums and totals.
  • Composite attribute : An attribute that can be divided into smaller units of meaning, like an address.
  • Multi-valued attribute : An attribute for which one instance can have multiple values. It is split off into a separate entity.
  • Domain : The range of values an attribute can take. Includes type, size, and constraints.
  • Integrity (consistency) : The state in which related data match up without contradicting each other.

📝 Practice Questions

Click a choice to reveal the answer and explanation.

Question 1

Which is the LEAST appropriate statement about attributes?

Question 2

In the online store's Order entity, which attribute classification by nature does "the order total, computed by multiplying each order item's quantity and unit price and summing them" fall under?

Question 3

Which of the following is the most appropriate statement about a domain?

Question 4

Which is the most appropriate statement about derived attributes?

Question 5

When a single customer can register multiple shipping addresses, which is the most appropriate way to express this in a relational data model?

PreviousEntitiesWeek 1 · Day 3Next RelationshipsWeek 1 · Day 5

Official references

  • SQLD official exam syllabus(opens in a new tab)

On this page

  • Key Takeaways
  • What Describes a Single Order?
  • Definition
  • Relationships Among Entities, Instances, Attributes, and Attribute Values
  • Classification by Nature
  • Why Be Careful with Derived Attributes
  • Classification by How They Compose an Entity
  • Classification by Composition and Number of Values
  • Domain
  • Naming Attributes
  • Glossary
  • Practice Questions