Chapter 9 - Data Design

Updated 5 Oct 2026

🗄️ Chapter 9 — Data Design Cheat Sheet

DES329 System Analysis & Design | Final Exam Prep


🧱 Data Design Concepts

Data Structure

A framework for organizing, storing, and managing data — made up of files or tables that interact with each other.

Each file/table stores data about: people, places, things, or events.


File-Oriented vs. Relational Model

File-Oriented (Mario's Shop)Relational Model (Danica's Shop)
StructureSeparate files per systemTables linked by a common field
ProblemData entered twice in different filesEnter once, link everywhere
ResultData redundancy — inefficient, error-proneNo duplication, consistent data

📸 Include Mario vs Danica diagram (Figure in textbook) here

🍎 Analogy: Mario = two separate notebooks where you rewrite the mechanic's name every time. Danica = one shared database with a single Mechanic No that links everything together.

Why relational over file-oriented? → Eliminates redundancy, ensures consistency, allows one data change to propagate everywhere automatically.


Database Management System (DBMS)

A collection of tools, features, and interfaces that enables users to add, update, manage, access, and analyze data.

Advantages:

  • Scalability
  • Economy of scale
  • Enterprise-wide application support
  • Stronger standards and better security
  • Data independence — changing physical storage doesn't affect how users see data

🍎 Analogy: DBMS = Google Drive for an organization. Everyone accesses the same data without emailing files back and forth.

One database, many systems: A single sales database can simultaneously support Inventory, Accounting, Order, and Production systems.


🔧 DBMS Components

Interfaces

User TypeRole
UsersWork with predefined queries and switchboard commands
Database Administrators (DBAs)Responsible for DBMS management and support
Related ISOther information systems that use the DBMS

Schema vs. Subschema

TermDefinition
SchemaDescription of all fields, tables, and relationships in the database — the full map
SubschemaThe portion of the database that a particular system or user is allowed to access

🍎 Analogy: Schema = the full floor plan of a warehouse. Subschema = the specific zone each employee has a keycard for.

Physical Data Repository

  • Contains schema and subschemas
  • Can be centralized (one location) or distributed (multiple locations)
  • Uses ODBC (Open Database Connectivity) compliant software to communicate

🌐 Web-Based Design

Databases for web are created using languages independent of HTML.
Goal: Connect the database to the web for viewing and updating data.

Middleware = the bridge that integrates the web server and database server, and translates data into HTML.

Web Request Flow (4 Steps)

📸 Include Figure 9-9 (Web Request Flow) from textbook here

1. Client workstation → requests a web page → Web Server
2. Web Server → uses middleware → sends query → Database Server
3. Database Server → responds with data → Middleware
4. Middleware → translates to HTML → Web Server → sends page to Client's browser

🍎 Analogy: Like ordering food at a restaurant. You (client) tell the waiter (web server). Waiter tells the kitchen (database). Kitchen sends food back. Waiter serves it to you.

Key concern: Web-based data must be secure yet accessible to authorized users.


📖 Data Design Terminology

Basic Terms

TermDefinition
EntityA person, place, thing, or event for which data is collected
Table / FileContains a set of related records about a specific entity
Field (Attribute)A single characteristic or fact about an entity
Common FieldAn attribute that appears in more than one table (used to link them)
Record (Tuple)A set of related fields describing one instance of an entity

Key Fields

Key TypeDefinition
Primary KeyField(s) that uniquely and minimally identify a record — no two records have the same value
Candidate KeyA field that could serve as a primary key (there may be several candidates)
Foreign KeyA field in one table that must match a primary key in another table — establishes a relationship
Secondary KeyField(s) used to access/retrieve records (not necessarily unique)

Primary Key⇒Unique+Minimal\boxed{\text{Primary Key} \Rightarrow \text{Unique} + \text{Minimal}}

Primary vs Foreign Key: Primary key = the ID of a record in its own table. Foreign key = a copy of someone else's primary key in your table, used to link the two.

e.g., Student table has student_id (PK). Registration table has student_id as a FK — pointing back to the Student table.

Primary vs Candidate Key: There might be multiple fields that could uniquely identify a record (e.g., student_id, national_id, email). Each of those is a candidate key. You pick one to be the primary key. The rest are just candidates.

Referential Integrity

A set of rules that avoids data inconsistency — ensures a foreign key value always refers to an existing primary key in the related table.

🍎 If a JOB record references Mechanic No = 99 but no mechanic with ID 99 exists — that's a referential integrity violation.


📊 Entity-Relationship Diagrams (ERDs)

A graphic representation of all entities in a system and the relationships between them.

Drawing an ERD

  • Entities → rectangles, labeled with singular nouns
  • Relationships → diamonds, labeled with verbs
  • Read as plain English: "A DOCTOR treats a PATIENT"

Three Types of Relationships

One-to-One (1:1)

Exactly one instance of entity A relates to exactly one instance of entity B.

Examples:

  • OFFICE MANAGER heads OFFICE
  • SOCIAL SECURITY NUMBER assigned to PERSON
  • VEHICLE ID assigned to VEHICLE

📸 Include 1:1 ERD diagram from textbook here

One-to-Many (1:M)

One instance of A relates to many instances of B, but each B relates to only one A.

Examples:

  • DEPARTMENT employs EMPLOYEE
  • CUSTOMER places ORDER
  • FACULTY ADVISOR advises STUDENT

📸 Include 1:M ERD diagram from textbook here

🍎 One teacher (1) teaches many students (M) — but each student has only one advisor.

Many-to-Many (M:N)

One instance of A relates to many instances of B, and vice versa.
Must be resolved using an associative entity (a junction/bridge table).

Examples:

M:N RelationshipAssociative Entity Created
STUDENT enrolls in CLASSREGISTRATION
PASSENGER reserves seat on FLIGHTRESERVATION
ORDER lists PRODUCTORDER LINE

📸 Include M:N ERD diagram from textbook here

Why does M:N need an associative entity? You can't store "many" values in a single cell. The bridge table breaks the relationship into two 1:M relationships — one from each side into the middle table.


Cardinality (Crow's Foot Notation)

Describes the numeric relationship between entities — how many of one can relate to how many of another.

SymbolMeaningUML Equivalent
‖One and only one1
‖> (bar + crow's foot)One or many1..*
○> (circle + crow's foot)Zero, one, or many0..*
○‖ (circle + bar)Zero or one0..1

📸 Include cardinality symbols diagram from textbook here 📸 Include Figure 9-18 (cardinality examples) from textbook here

Cardinality Examples (READ BOTH DIRECTIONS — exam likely!)

RelationshipReading
CUSTOMER ‖ PLACES ○> ORDEROne and only one CUSTOMER places zero to many ORDERs
ORDER ‖ INCLUDES ‖> ITEM ORDEREDOne and only one ORDER includes one or many ITEMS ORDERED
EMPLOYEE ‖ HAS ○‖ SPOUSEOne and only one EMPLOYEE has zero or one SPOUSE
EMPLOYEE ○> ASSIGNED TO ○> PROJECTZero/one/many EMPLOYEEs assigned to zero/one/many PROJECTs

📸 Include Figure 9-19 (Library ERD with crow's foot notation) from textbook here

How to read crow's foot notation: Read the symbol closest to the entity to get the min/max on that side. Circle = "could be zero" (optional). Bar = "at least one" (mandatory). Crow's foot = "could be many."


📐 Data Normalization

Creating table designs by assigning specific fields to each table to eliminate redundancy and anomalies.

Standard notation: \boxed{\text{TABLE_NAME}(\underline{\text{PrimaryKey}},\ \text{Field2},\ \text{Field3},\ \ldots)} Primary key field(s) are underlined.

Repeating Group

A set of fields that can occur multiple times in a single record with different values.
The presence of a repeating group = table is unnormalized (UNF).

📸 Include UNF/repeating group diagram from textbook here


Normalization Stages

UNF → Unnormalized

Problem: Contains repeating groups (e.g., one ORDER row has multiple PRODUCT entries in the same row).


1NF — First Normal Form

1NF: No repeating groups. Expand PK to include the repeating group’s key.\boxed{\text{1NF: No repeating groups. Expand PK to include the repeating group's key.}}

Rule: Does not contain a repeating group.

How to fix UNF → 1NF:

  • Each repeating group becomes its own row
  • Expand the primary key to be composite: (ORDER + PRODUCT NUMBER)

📸 Include 1NF diagram from textbook here

🍎 Like changing "Order #1: products 304, 633, 684 in one cell" → three separate rows, one per product.


2NF — Second Normal Form

2NF: In 1NF + All non-key fields depend on the WHOLE primary key (no partial dependency)\boxed{\text{2NF: In 1NF + All non-key fields depend on the WHOLE primary key (no partial dependency)}}

Prerequisite: Must be in 1NF first.
Rule: Every non-key field must depend on the entire composite key — not just part of it.

Partial dependency = a non-key field depends on only part of the composite key → move it to a separate table.

Example:

  • Composite PK = (ORDER, PRODUCT NUMBER)
  • DESCRIPTION depends only on PRODUCT NUMBER (not on ORDER) → partial dependency → move to PRODUCT table

Result (from ORDER example):

  • ORDER table: ORDER, ORDER DATE
  • PRODUCT table: PRODUCT NUMBER, DESCRIPTION, SUPPLIER NUMBER, SUPPLIER NAME, ISO
  • ORDER LINE table: ORDER, PRODUCT NUMBER, NUMBER ORDERED

📸 Include 2NF diagram from textbook here


3NF — Third Normal Form

3NF: All non-key fields depend on the KEY, the WHOLE KEY, and NOTHING BUT the KEY\boxed{\text{3NF: All non-key fields depend on the KEY, the WHOLE KEY, and NOTHING BUT the KEY}}

Rule: No transitive dependencies — a non-key field must NOT depend on another non-key field.

Transitive dependency = non-key field A depends on non-key field B (instead of depending on the PK).

Example:

  • In PRODUCT table: SUPPLIER NAME depends on SUPPLIER NUMBER (not on PRODUCT NUMBER) → transitive dependency
  • Fix: Split into:
    • PRODUCT: PRODUCT NUMBER, DESCRIPTION, SUPPLIER NUMBER
    • SUPPLIER: SUPPLIER NUMBER, SUPPLIER NAME, ISO

📸 Include 3NF diagram from textbook here

🍎 The easy mnemonic: "The key, the whole key, and nothing but the key — so help me Codd."


Normalization Quick Summary

StageRuleProblem it solves
UNFHas repeating groups— (starting point)
1NFNo repeating groups; expand PKEliminates repeating data in one cell
2NFNo partial dependencies on composite PKEliminates redundancy from partial key reliance
3NFNo transitive dependenciesEliminates non-key → non-key dependencies

Why normalize? → Redundant data = storage waste + update anomalies. If supplier name is stored in 100 product rows and the supplier renames, you must update 100 rows — and if you miss one, data is inconsistent.


🔑 Codes

Codes are shorter than the data they represent.

Benefits:

  • Save storage space and costs
  • Decrease data entry and transmission time
  • Reveal or conceal information
  • Reduce data input errors
  • Easier to remember

Types of Codes

TypeDescriptionExample
Sequence codesNumbers/letters assigned in orderEmployee #001, #002, #003
Block sequence codesBlocks of numbers for categories100–199: Sales, 200–299: HR
Category codesLetters identifying a groupM = Male, F = Female
Abbreviation codesAlphabetic abbreviationsTH = Thailand
Mnemonic codesEasy-to-remember combinationsNYC = New York City
Significant digit codesSubgroups of digits with meaning12-34-56 (dept-floor-room)
Derivation codesCombine data from multiple attributesFirst 3 letters of name + birth year
Cipher codesUse a keyword to encodeSecret encoding
Action codesIndicate what action to takeD = Delete, U = Update

Designing Codes — Rules

  • Keep codes concise and consistent
  • Allow for expansion (future growth)
  • Keep codes stable and unique
  • Use sortable codes with a simple structure
  • Avoid confusion; make codes meaningful
  • Use a code for a single purpose only

💾 Data Storage and Access

Data Warehouse vs. Data Mart vs. Data Mining

ConceptDefinition
Data WarehouseIntegrated collection of data from multiple systems across the entire organization — any dimension can be queried
Data MartA smaller warehouse designed to serve a specific department (e.g., Marketing, Finance)
Data MiningLooks for meaningful patterns and relationships in large datasets

📸 Include Data Warehouse diagram (Figure showing dimensions: Time Period, Customer, Sales Rep) from textbook here

Warehouse vs Mart: Warehouse = the whole company's data in one place. Mart = a department's slice of that warehouse. Mart is always a subset of the Warehouse.

🍎 Analogy: Data Warehouse = the main stock room of a department store. Data Mart = the stock room for just the shoe department.

Logical vs. Physical Storage

TypeDescription
Logical storageData as the user sees and accesses it — regardless of how or where it's physically stored
Physical storageStrictly hardware-related — reading/writing binary data to actual physical media

Why does this distinction matter? Users don't need to know that "Customer" data is split across three servers. They just see a clean table. That's logical storage abstracting physical storage.

🍎 Logical = what you see in Excel. Physical = the actual bits written to the SSD.


🔤 Data Coding (Character Encoding)

FormatUsed In
EBCDICMainframe computers and high-capacity servers
ASCIIMost personal computers
Binary storage formatRepresents numbers as actual binary values
UnicodeInternational standard — 2 bytes (16 bits) per character

Unicode=16 bits per character⇒65,536 possible characters\boxed{\text{Unicode} = 16 \text{ bits per character} \Rightarrow 65{,}536 \text{ possible characters}}

Unicode supports Thai, Chinese, Arabic, and virtually every human language in one standard.

Storing Dates

  • ISO format: YYYYMMDD\boxed{YYYYMMDD} — 4-digit year, 2-digit month, 2-digit day
  • Absolute date: total number of days elapsed from a specific base date (used for date arithmetic)

🔒 Data Control

A well-designed DBMS must provide built-in control and security.

Control MeasurePurpose
Limited access to files and databasesPrevent unauthorized viewing/modification
User ID and passwordsAuthentication
Permissions and encryptionControl what each user can do; protect data in transit
Backup copiesRetained for a specified period
Recovery proceduresRestore lost or damaged data

📊 Quick Comparison — Key "This vs That"

vsAB
File-oriented vs RelationalSeparate files, data duplicatedLinked tables via common field, no redundancy
Schema vs SubschemaFull database descriptionPortion a specific user/system can access
Primary vs Foreign KeyUniquely identifies a record in its own tableReferences a PK in another table to link them
Primary vs Candidate KeyThe chosen unique identifierAny field that could be PK (multiple may exist)
Data Warehouse vs Data MartEntire organization's dataOne department's subset of that data
Logical vs Physical StorageHow users see dataHow data is actually stored in hardware
1NF vs 2NF vs 3NFNo repeating groupsNo partial dependencies

📝 Key Definitions (Exam-Ready)

TermDefinition
Data structureA framework for organizing, storing, and managing data
DBMSCollection of tools for adding, updating, managing, accessing, and analyzing data
SchemaDescription of all fields, tables, and relationships in the database
SubschemaThe portion of the database a specific user or system can access
ODBCOpen Database Connectivity — standard for DBMS software communication
MiddlewareSoftware that integrates different applications and allows data exchange
EntityA person, place, thing, or event for which data is collected
Primary KeyField(s) that uniquely and minimally identify a record
Candidate KeyA field that could serve as a primary key
Foreign KeyA field that must match a primary key in another table
Referential integrityRules ensuring foreign key values always refer to existing primary keys
ERDEntity-Relationship Diagram — graphic showing entities and their relationships
Associative entityA bridge table that resolves a M:N relationship into two 1:M relationships
CardinalityThe numeric relationship between two entities
NormalizationProcess of designing tables to eliminate redundancy and anomalies
Repeating groupA set of fields that can occur multiple times in one record — signals UNF
Partial dependencyNon-key field depends on only part of a composite PK — violates 2NF
Transitive dependencyNon-key field depends on another non-key field — violates 3NF
Data WarehouseIntegrated collection of data from multiple systems across the organization
Data MartA smaller warehouse serving a specific department
Data MiningLooking for meaningful patterns and relationships in large datasets
Logical storageData as seen by the user, regardless of physical location
Physical storageActual binary data written to hardware
Unicode16-bit character encoding supporting 65,536 characters and international languages
ISO date formatYYYYMMDD — international standard for storing dates
Absolute dateNumber of days elapsed from a specific base date