Based on the SQLD exam syllabusReport an error
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?"
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.
| Relationship | Rule | Online store example |
|---|---|---|
| Entity - Instance | An entity has two or more instances | The Order entity has O1001, O1002 ... |
| Entity - Attribute | An entity has two or more attributes | Order number, order date, payment amount ... |
| Attribute - Attribute value | An attribute has only one attribute value per instance | O1001 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 valuecontact 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 | Meaning | Online store example |
|---|---|---|
| Basic attribute | An attribute that originally exists, pulled directly from business analysis. The most common | Product name, product price, order date, order quantity |
| Designed attribute | An attribute that does not originally exist in the business but was newly created during design. Codes and serial numbers fall here | Order status code, order item serial number |
| Derived attribute | An attribute obtained by calculating or transforming other attributes | Order total (sum of quantity × unit price), customer cumulative purchase amount |
10, 20, 30 makes it a designed attribute.[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,000quantity × 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.⚠️ 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 | Meaning | Order entity example |
|---|---|---|
| PK attribute (Primary Key) | An attribute that can identify an entity's instances | Order number |
| FK attribute (Foreign Key) | An attribute included because of a relationship with another entity | Customer ID (comes from the Customer entity) |
| Regular attribute | All the remaining attributes that are neither PK nor FK | Order date, shipping address, payment amount |
Depending on the textbook, this classification is explained along two axes. The names are similar, so we organize them together.
| Criterion | Classification | Meaning | Online store example |
|---|---|---|---|
| Can it be split? | Simple (single) attribute | Cannot be divided into smaller units | Order quantity, product price |
| Composite attribute | Can be divided into multiple units of meaning | Address (city, district, neighborhood, detailed address), customer name (first name, last name) | |
| How many values? | Single-valued attribute | One value per instance | Date of birth |
| Multi-valued attribute | May have multiple values per instance | A customer's multiple shipping addresses, a product's multiple colors |
A domain is the range of values each attribute can take.
| Attribute | Domain example |
|---|---|
| Order quantity | An integer from 1 to 999 |
| Order status code | One of 10, 20, 30, 40 |
| Customer name | A string of up to 50 characters, NULL not allowed |
| Order date | Date type |
NUMBER, VARCHAR2(50)) and CHECK and NOT NULL constraints.| Principle | Good example | Bad example |
|---|---|---|
| Names used in the business | PaymentAmount | PayAmtVal |
| Don't use descriptive names | OrderDate | TheDateTheCustomerOrdered |
| Limit abbreviations | ShippingAddress | ShAddr |
| Unique names across the whole model recommended | OrderDate, ShipDate | Date, Date |
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.
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?