Based on the SQLD exam syllabusReport an error
An online store has customers and products, and customers order products. To move that sentence into a database, you first have to decide "what to store" in a diagram. Drawing that diagram is data modeling.
| Perspective | Definition |
|---|---|
| Business analysis | A technique for analyzing the business from a data perspective in order to build an information system |
| Representation | The process of representing real-world data (What) in an agreed-upon notation |
| Design | The analysis and design process for building a database |
| Characteristic | Meaning | Online store example |
|---|---|---|
| Abstraction | Extract the commonalities among many real-world phenomena and fit them into a fixed format | Group countless individual shoppers into a single frame called "Customer" |
| Simplification | Express complex reality easily using agreed-upon conventions (notation, language) | Draw the link between a customer and an order as a single line |
| Clarification | Remove ambiguity and describe things so they can be read in only one way | Decide whether "order date" means the payment time or the time the order was received |
Modeling looks at a business from three directions.
| Perspective | Question it asks | Online store example |
|---|---|---|
| Data perspective | What data is the business related to? (What, Data) | What do we store for customers, products, and orders? |
| Process perspective | What does the business actually do? (How, Process) | Receiving orders, payment, shipping |
| Interaction perspective (data and process) | How is the data affected by the way the business is processed? (Interaction) | How does the stock quantity change when an order is canceled? |
| Importance | Meaning |
|---|---|
| Leverage | If the data model changes during system construction, the programs and tables that depend on it change too. The later you change it, the higher the cost |
| Conciseness | Shows complex information requirements concisely in a single model. Developers and business users talk while looking at the same diagram |
| Data Quality | Prevents the problem of the same data being scattered in multiple places with mismatched values, right at the model stage |
| Caution | Meaning | Online store example |
|---|---|---|
| Duplication | The same information is stored in multiple places | A customer's address is stored separately in both the customer table and the order table |
| Inflexibility | The model is weak against business change, so even small changes require major model changes | Payment methods are hard-coded as columns is_card and is_bank_transfer, so a new column is added every time a new payment method appears |
| Inconsistency | Relationships between data are not defined, so contradictory values arise | A customer's tier was changed, but the tier discount rate stored in the order is still the old value |
⚠️ Watch out for answer choices that mix up the 3 importance points (Leverage, Conciseness, Data Quality) and the 3 cautions (Duplication, Inflexibility, Inconsistency). "Inconsistency" is something to avoid, while "Data Quality" is something to protect.
| Element | English | Online store example |
|---|---|---|
| The thing the business is involved with | Things | Customer, Product, Order |
| The characteristics that thing has | Attributes | Customer name, product price, order date |
| The relationship between the things the business is involved with | Relationships | A customer places an order, an order contains products |
These three elements are the topics of Day 3 (entities), Day 4 (attributes), and Day 5 (relationships), respectively.
In modeling, we distinguish between the frame called "Customer" and one individual such as "customer Gildong Hong."
| Category | Set (plural, type) | Individual (singular, value) |
|---|---|---|
| Thing | Entity Type, Entity | Entity Instance, Occurrence |
| Characteristic | Attribute | Attribute Value |
| Relationship | Relationship | Pairing |
Entity : Customer
├─ Instance 1 : Customer ID C001, Customer name Gildong Hong
└─ Instance 2 : Customer ID C002, Customer name Younghee Kim
Attribute : Customer name
Attribute value : Gildong Hong, Younghee KimAn ERD (Entity Relationship Diagram) is a diagram that shows entities and relationships. It originated from the E-R model proposed by Peter Chen in 1976.
An ERD is usually drawn in the following order.
| Order | What you do |
|---|---|
| 1 | Draw the entities |
| 2 | Place the entities appropriately |
| 3 | Set up relationships between entities |
| 4 | Write the relationship names |
| 5 | Specify the relationship's participation (cardinality) |
| 6 | Specify whether the relationship is required (optionality) |
┌──────────┐ places ┌───────┐ contains ┌────────────┐ refers to ┌─────────┐
│ Customer │ ──────────── │ Order │ ──────────── │ Order Item │ ───────────── │ Product │
└──────────┘ └───────┘ └────────────┘ └─────────┘| Element | Meaning |
|---|---|
| Completeness | All the data the business needs is defined in the model without omission |
| Elimination of duplication | Record the same fact only once |
| Business rules | Express rules such as "an order must have at least one product" in the model |
| Data reuse | Integrate data so it is not tied to a specific program and can be used across multiple business functions |
| Communication | Business users and developers can understand the business by looking at the model |
| Integration | The same data is defined only once across the whole organization and referenced from many places |
Tomorrow we'll cover how to divide modeling into three stages (conceptual, logical, physical) and the three-level schema, which views a database in three layers.
Click a choice to reveal the answer and explanation.
Question 1
Which of the following is the LEAST related to the characteristics of data modeling?
Question 2
Which is the most appropriate statement about points to watch out for in data modeling?
Question 3
Which correctly matches the three perspectives of data modeling with their descriptions?
Question 4
Which of the following correctly matches a component of a data model with the term for its individual unit?
Question 5
If the data model is changed during system construction, the related programs and tables must also be changed, which is very costly. Which importance of data modeling relates to this phenomenon?