0% found this document useful (0 votes)
82 views24 pages

Phase 2 & Database Design: MSTU 5031

The document discusses the process of database design, including defining requirements, analyzing requirements, exploring alternatives, modeling entities and their relationships, and normalizing the data to avoid redundancy and ensure referential integrity. It covers logical design tasks like identifying entities, attributes, and relationships, and physical design considerations like data types, field sizes, and defining primary and foreign keys. The goal of the design process is to create a structured database that meets the needs of the application and ensures data consistency.

Uploaded by

Yusuf Alam
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views24 pages

Phase 2 & Database Design: MSTU 5031

The document discusses the process of database design, including defining requirements, analyzing requirements, exploring alternatives, modeling entities and their relationships, and normalizing the data to avoid redundancy and ensure referential integrity. It covers logical design tasks like identifying entities, attributes, and relationships, and physical design considerations like data types, field sizes, and defining primary and foreign keys. The goal of the design process is to create a structured database that meets the needs of the application and ensures data consistency.

Uploaded by

Yusuf Alam
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 24

Phase 2

&
Database Design
MSTU 5031
Phase 2
• Defining requirements
• Analyzing requirements
• Exploring alternatives
Defining Requirements
• Inputs
• Outputs
• Processes
• Timing
• User Controls
Amazon.com
• Inputs
– Index page
• Search string
• Clicking on links
• Outputs (nouns)
– Search results
– Web page
• Processes (verbs)
– Search database for search string
– Retrieve web page
• Timing
• User controls
Online Book Publishing Store
• Publishing company with 3 subsidiary lines
• The database stores information that editors,
administrators and executives might want about
books, their authors, their editors, and the
company’s financial arrangements.
• The database can produce many kinds of reports
summarizing current sales, comparing different
book lines, discovering which editors work with
which authors, etc…
Steps
1. Investigate
2. List all entities and all possible attributes
3. Entity-Relationship diagrams
4. Ensure each entity has attribute(s) you can use to
uniquely identify any row in a future table.
5. Consider relationship between entities
6. Analyze according to normalization guidelines
7. SQL
8. Reevaluate
What is database design?
• The process of deciding what the database
will look like.
• Database design involves choosing
– The tables
– Columns for each table
– How the table and columns interact with each
other
• Iterative process
Characteristics of Good &
Design
• Good design… • Bad design…
– Makes your interactions – Foster misunderstandings
with the database easier to of query results
understand – Increase the risk of
– Guarantees the consistency introducing inconsistencies
of the database in the data.
– Paves the way for the – Force redundant data entry
highest performance your – Make life difficult if you
system can deliver. need to change the structure
of the tables you’ve built
and filled with data
Logical Structure
• Database design is concerned with the
logical structure of a database.
• Independent of what the user eventually
sees.
• Independent of the physical structure and
storage of the database.
Approach to Database Design
• Design aids
– Questions
– Business Rules
– Entity-relationship modeling
– Normalization
– Data dictionary/definitions
Questions & Business Rules
• Which authors live in • An author may have
California? written more than one
• Which business book book
costs more than $9.95? • A book may have been
• How much do we owe a collaborative project
the author of Life of more than one
Without Fear? author
Data Entities & Relationships
• Entity relationship modeling
– The things - entities about which information
will be store in the database system
– The properties of these things
– The relationships among them
Normalization
• Protecting your data integrity by avoiding
duplicate data.
• The normalization guidelines are most
useful when you’ve identified which
columns go in which table.
Normalization
• Set of design standards called normal forms
• Five normal forms are widely accepted
• Making your tables match these standards is
normalization
• Form progresses in order from first through
fifth
• Each form implies that the requirements of
the previous form have been met
Why Normalize?
• Normalization guidelines involves splitting tables into
tow or more tables with fewer columns, designating
primary-foreign key relationships into new smaller
tables that can be reconnected with the join operation.
• This help reduce data redundancy within tables
• Intentional duplication is not the same as redundancy
• The maintenance of intentional duplication
(consistency) between primary and foreign keys is a
major point of referential integrity.
Entities & Attributes
• Entities
• Attributes
Entities
• Authors
• Books
• Editors
• Subsidiary publishing houses
Properties or Attributes of Each
Entity
• Book
– Book’s name
– Book’s price
– Book’s publication date
• Author
– Author’s name
– Author’s address
– Author’s telephone number
• Editor
– Editor’s name
– Editor’s address
– Editor’s telephone number
• Publisher
– Publisher's name
– Publisher’s address
Preliminary Sketch
Titles Authors Editors Publishers

name name name name


price address address address
Pubdate Phone Phone
Preliminary Sketch
Titles Authors Editors Publisher
s
name au_lname ed_lname name
price au_fname ed_fname address
pubdate address address
phone phone
Defining Primary Keys
Titles Authors Editors Publishers

title_id au_id ed_id pub_id


name au_lname ed_lname name
price au_fname ed_fname address
pubdate address address
phone Phone
Unique Identifiers
• Keys
– Pieces of data that help to identify a row of information
in a table.
• Types of keys
– Primary
• Always have a value (it cannot be null)
• Have a value that remains the same (never changes)
• Have a unique value for each record in the table
– Foreign
• A column in one table whose values match those of the primary
key in some other table.
Relationships & Foreign Keys
• One to many
• Many to many
• One to one

• Foreign key - a column in one table whose


values match those of the primary key in
some other table.
More towards the physical model
Requirements for Data dictionary

• Entity
– Attribute name
– Null? (required field, primary key, foreign key)
– Field size
– Data type (varchar, date, )
– Instance

You might also like