Professional Documents
Culture Documents
Information Technology
Seminar 5: Database I
Database Design
Learning Objectives
To understand how data is represented
Data is a a fact
or observation
about people,
places, things,
and events.
Valuable resource
Information
◦ Timely and accurate data can trigger beneficial
actions
◦ Basis for knowledge
◦ Used in decision making
Representing the Real World as Data
What Data are Businesses interested in?
Entity
◦ a person, place, thing, or event on which we maintain
information
◦ Examples: Employees, Customers, Products, Warehouses
an entity
Spreadsheet Limitations
Things get complicated when we want to keep
track of several inter-related entities
For example:
◦ Customers
◦ Products
◦ Orders
Database for a small business that sells used cars and also provides
service
Database ex work for the cars it sells
Data Representation
A field or data element is
the smallest unit of data
that has meaning to
humans.
A record is a collection of
fields that contain
information concerning a
specific thing or event.
A collection of records is
called a file.
Flat Files
Hierarchical (e.g., XML, IMS)
Network (e.g., Codasyl)
Relational (e.g., Oracle, MS Access)
Object-Oriented (e.g., Orion, O2)
Relational Databases
Most popular method for organizing and
storing information is the relational
database model which stores information in
files or tables that have rows and columns
Popular software applications include:
◦ Microsoft Access
◦ Oracle
◦ Sybase
◦ DB2
◦ FileMaker
Database Management System
Database Management System (DBMS)
◦ Allows the creation of a database
◦ Supports specialized languages for easy retrieval
of data from a set of inter-related tables
◦ Examples: Microsoft Access
diagram(ERD)
Components of an ERD
◦ Entities: corresponds to tables
◦ Attributes: corresponds to fields of a table
◦ Relationships: represents links between tables
What Do Entities Represent?
Refers to things about which we want to store
information (customers, employees, products
etc.)
Relationship participation
• Mandatory: must have a corresponding occurrence
• Optional: may not have a corresponding occurrence
• Rectangle – entity
• Solid line – relationship
• | - single relationship
• 0 – zero/optional
relationship
• Crow’s foot ( ) –
multiple relationship
Sample Invoice
ABC Corporation
Invoice
Total: 1,536.80
customer
A product may be on 0 Invoice (product
1 M
Developing an ERD
Iterative Process
Step1: Read the case (requirements) & capture the
business rules
Step2: Identify and draw entities (nouns) and their
attributes including key attributes
Step 3: Identify relationships (verbs) as described
in the case and the numerical nature of the
relationship (cardinality)
Step3: Modify the ERD:
as you read the case and as more information is provided
When there are M:N relationships: create intersection
table
Step 4: Repeat process until database designers
(you) and users agree ERD is complete
Group Exercise #1:
Draw ERD Diagram
Bottom-up Design
◦ Examine the different forms and records and
extract the entities, attributes and their
relationships
◦ Derive the data model from the details of current
operations
Moving from Data Model to Database
Design
Database Schema
Design of a relational database that could be
implemented with a DBMS
◦ Identify tables, primary keys, foreign keys
33
Database Schema for Customer and
Invoice
CUSTOMER(CustomerNumber, CustomerName,
CustomerAddress, Customer Phone)
CUSTOMER(CustomerNumber, CustomerName,
CustomerAddress, Customer Phone)
PRODUCT(ProductNumber, ProductDescription,
Price)
INVOICE-PRODUCT(InvoiceNumber,
ProductNumber, Quantity)
Transforming ERD into a Database
Schema - Summary
Entities become Tables