0% found this document useful (0 votes)
20 views39 pages

SADCW 7e Chapter09

Uploaded by

jokernet19
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views39 pages

SADCW 7e Chapter09

Uploaded by

jokernet19
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 39

Chapter 9

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 1
Designing the Database

Chapter 9

Systems Analysis and Design in a Changing World 7th Ed


Satzinger, Jackson & Burd

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights 2
reserved.
Chapter 9: Outline

Databases and Database Management Systems


Database Design and Administration
Relational Databases
Distributed Database Architectures
Protecting the Database

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights
3
reserved.
Learning Objectives
Explain the responsibilities of the data
administrator and database administrator
Design a relational database schema based on a
class diagram
Evaluate and improve the quality of a database
schema
Describe the different methods for configuring
distributed databases
Explain the importance of and methods for
protecting the database

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights 4
reserved.
Overview
Databases and database management systems are
important components of a modern information
system
Database design transforms the domain model
class diagram into a detailed database model for
the system
A database management system is used to
implement and interact with the database

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 5
Databases and DBMSs
Database (DB) -- an integrated collection of stored data that
is centrally managed and controlled
Database management system (DBMS) -- a system software
component that manages and controls one or more
databases
Schema -- database component that contains descriptive
information about the data stored in the physical data store
(sometimes called metadata)
Structured Query Language -- the standard query language
to access and update data in a relational D BMS

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights
reserved. 6
DBMS Components

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 7
Database Schema
Organization of individual stored data items into higher
level groups, such as tables
Associations among tables or classes
Details of physical data store organization, including
types, lengths, locations, and indexing of data items
Access and content controls, including allowable values
for specific data items, value dependencies among
multiple data items, and lists of users allowed to read or
update data items

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 8
Characteristics of a DBMS
Simultaneous access by many users and many
applications
Direct access to data with a data interface
Uniform and consistent access
Integration and distribution of data across multiple
servers

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 9
Database Design and Administration (1 of 4)
How does database design integrate within the existing
technology architecture?
Technology Architecture – hardware and networks
Single desktop – single copy of database
Shared database – residing on local LAN
Large database – multiple servers within a single data farm
Very large database – multiple servers across multiple data
farms (global)

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 10
Database Design and Administration (2 of 4)
How does database design integrate within the project
plan?
Water-fall development – design and implement
database first
Iterative development – database is foundational, early
iterations need to focus on data and key portions of
the database
Iterative development – important to consider
database impacts of all subsystems

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 11
Database Design and Administration (3 of 4)

Who is involved in database design?


Data Administrator (DA) – person in charge of
structure and integrity of the data
Data standards – naming, definition, data typing
Data use – ownership, accessibility, confidentiality
Data quality – validation rules, completeness,
currency

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 12
Database Design and Administration (4 of 4)

Who is involved in database design?


Database Administrator (DBA) – person in charge of
safety and the operation of the database
Manage multiple DBMS environment
Protect the database and data – authentication
Maintain high-performance level
Backup data and define recovery procedures

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 13
DA and DBA Responsibilities

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 14
Relational Databases (1 of 2)
Relational database management system (RDBMS) -- a
DBMS that organizes data in tables (relations)
Table -- a two-dimensional data structure of columns
and rows
Row -- one horizontal group of data attribute values
Attribute -- one vertical group of data attribute values
Attribute value -- the value held in a single table cell

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 15
Relational Databases (2 of 2)
Key – an attribute or set of attributes, the values of which occur
only once in all the rows of the table
Candidate Key – an attribute or set of attributes that could server
as the primary key
Primary key – the key chosen by a database designer to
represent relationships among rows in different tables
Foreign key – an attribute that duplicates the primary key of a
different (or foreign) table

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 16
Partial Display of a Relational Database Table

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 17
An Association Between Two Classes

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 18
An Association Between Rows in Two Tables
(key and foreign key)

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 19
Designing Relational Databases: Based
on the Domain Model Class Diagram

1. Create a table for each class


2. Choose a primary key for each table (invent one, if necessary)
3. Add foreign keys to represent one-to-many associations
4. Create new tables to represent many-to-many associations
5. Represent classification hierarchies
6. Define referential integrity constraints
7. Evaluate schema quality and make necessary improvements
8. Choose appropriate data types
9. Incorporate integrity and security controls

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 20
RMO Classes

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 21
Initial Set of Tables: Based on RMO Domain Classes
Table Attributes

AccessoryPackage Category, Description


CartItem Quantity, CurrentPrice
Customer Name, MobilePhone, HomePhone, EmailAddress, Status
InventoryItem Size, Color, Options, QuantityOnHand, AverageCost, ReorderQuantity
OnlineCart StartDateTime, NumberOfItems, ValueOfItems, Status, ElapsedTime, HoldForDays

ProductComment Date, Rating, Comment


ProductItem Gender, Description, Supplier, Manufacturer, Picture
PromoOffering RegularPrice, PromoPrice
Promotion Season, Year, Description, StartDate, EndDate
Sale SaleDateTime, PriorityCode, ShippingAndHandling, Tax, TotalAmount,
MountainBucks, StoreID, RegisterID, ClerkID, TimeOnSite, ChatUse, LengthOfCall
SaleItem Quantity, SoldPrice, ShipStatus, BackOrderStatus

SaleTransaction Date, TransactionType, Amount, PaymentMethod

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 22
Initial Set of Tables: With Primary Keys Added (bold)
Table Attributes
AccessoryPackage AccessoryPackageID, Category, Description
CartItem CartItemID, Quantity, CurrentPrice
Customer AccountNumber, Name, MobilePhone, HomePhone, EmailAddress, Status
InventoryItem InventoryItemID, Size, Color, Options, QuantityOnHand, AverageCost,
ReorderQuantity
OnlineCart OnlineCartID, StartDateTime, NumberOfItems, ValueOfItems, Status, ElapsedTime,
HoldForDays
ProductComment ProductCommentID, Date, Rating, Comment
ProductItem ProductItemID, Gender, Description, Supplier, Manufacturer, Picture
PromoOffering PromoOfferingID, RegularPrice, PromoPrice
Promotion PromotionID, Season, Year, Description, StartDate, EndDate
Sale SaleID, SaleDateTime, PriorityCode, ShippingAndHandling, Tax, TotalAmount,
MountainBucks, StoreID, RegisterID, ClerkID, TimeOnSite, ChatUse, LengthOfCall
SaleItem SaleItemID, Quantity, SoldPrice, ShipStatus, BackOrderStatus
SaleTransaction SaleTransactionID, Date, TransactionType, Amount, PaymentMethod

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 23
Representing Associations
One-to-Many – Add primary key attribute of the
“one” class to the “many” class as a foreign key
Many-to-Many –
With an Association Class – Add primary keys of
endpoint classes as foreign keys and as candidate
keys. May also become primary key
Without an Association Class – Create new table.
Add primary keys of endpoint classes as foreign
keys and as candidate keys.

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights 24
reserved.
Initial Set of Tables: With Foreign Keys Added (in italics)
Table Attributes
Accessory Package AccessoryPackageID, Category, Description
Cartitem CartItemID, InventoryItemID, OnlineCartID, Quantity, CurrentPrice
Customer AccountNumber, Name, MobilePhone, HomePhone, EmailAddress, Status
InventoryItem InventoryItemID, ProductItemID, Size, Color, Options, QuantityOnHand, AverageCost,
ReorderQuantity
OnlineCart OnlineCartID, CustomerAccountNumber, StartDateTime, NumberOfItems, ValueOfItems,
Status, ElapsedTime, HoldForDays
ProductComment ProductCommentID, ProductItemID, CustomerAccountNumber, Date, Rating, Comment
ProductItem ProductItemID, Gender, Description, Supplier, Manufacturer, Picture
PromoOffering PromoOfferingID, RegularPrice, PromoPrice
Promotion PromotionID, Season, Year, Description, StartDate, EndDate
Sale SaleID, CustomerAccountNumber, SaleDateTime, PriorityCode, ShippingAndHandling, Tax,
TotalAmount, MountainBucks, StoreID, RegisterID, ClerkID, TimeOnSite, ChatUse,
LengthOfCall
SaleItem SaleItemID, InventoryItemID, SaleID, Quantity, SoldPrice, ShipStatus, BackOrderStatus
SaleTransaction SaleTransactionID, SaleID, Date, TransactionType, Amount, PaymentMethod

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights
reserved. 25
Association Class: PromoOffering added from
association class to table with two keys
Table Attributes
AccessoryPackage AccessoryPackageID, AccessoryCategory, Description
AccessoryPackageContents AccessoryPackageID, ProductItemID
CartItem InventoryItemID, OnlineCartID, Quantity, CurrentPrice
Customer AccountNumber, Name, MobilePhone, HomePhone, EmailAddress, Status
InventoryItem InventoryItemID, ProductItemID, Size, Color, Options, QuantityOnHand, AverageCost,
ReorderQuantity
OnlineCart OnlineCartID, CustomerAccountID, StartDateTime, NumberOfItems, ValueOfItems, Status,
ElapsedTime, HoldForDays
ProductComment ProductCommentID, ProductItemID, CustomerAccountNumber, Date, Rating, Comment
ProductItem ProductItemID, Gender, Description, Supplier, Manufacturer, Picture
PromoOffering PromotionID, ProductItemID, RegularPrice, PromoPrice
Promotion PromotionID, Season, Year, Description, StartDate, EndDate
Sale SaleID, CustomerAccountNumber, SaleDateTime, PriorityCode, ShippingAndHandling, Tax,
TotalAmount, MountainBucks, StoreID, RegisterID, ClerkID, TimeOnSite, ChatUse, LengthOfCall
SaleItem InventoryItemID, SaleID, Quantity, SoldPrice, ShipStatus, BackOrderStatus
SaleTransaction SaleTransactionID, SaleID, Date, TransactionType, Amount, PaymentMethod

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 26
Final Tables: Specialized subclasses included within
OnlineCart and Sale tables
Table Attributes
AccessoryPackage AccessoryPackageID, AccessoryCategory, Description
AccessoryPackageContents AccessoryPackageID, ProductItemID
CartItem InventoryItemID, OnlineCartID, Quantity, CurrentPrice
Customer AccountNumber, Name, MobilePhone, HomePhone, EmailAddress, Status
InventoryItem InventoryItemID, ProductItemID, Size, Color, Options, QuantityOnHand, AverageCost,
ReorderQuantity
OnlineCart OnlineCartID, CustomerAccountID, StartDateTime, NumberOfItems, ValueOfItems, Status,
ElapsedTime, HoldForDays
ProductComment ProductCommentID, ProductItemID, CustomerAccountNumber, Date, Rating, Comment
ProductItem ProductItemID, Gender, Description, Supplier, Manufacturer, Picture
PromoOffering PromotionID, ProductItemID, RegularPrice, PromoPrice
Promotion PromotionID, Season, Year, Description, StartDate, EndDate
Sale SaleID, CustomerAccountNumber, SaleDateTime, PriorityCode, ShippingAndHandling, Tax,
TotalAmount, MountainBucks, StoreID, RegisterID, ClerkID, TimeOnSite, ChatUse, LengthOfCall
SaleItem InventoryItemID, SaleID, Quantity, SoldPrice, ShipStatus, BackOrderStatus
SaleTransaction SaleTransactionID, SaleID, Date, TransactionType, Amount, PaymentMethod

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 27
Final Tables: Specialized subclasses as separate
tables (1 of 2)
Table Attributes
AccessoryPackage AccessoryPackageID, AccessoryCategory, Description
AccessoryPackageContents AccessoryPackageID, ProductItemID
CartItem InventoryItemID, OnlineCartID, Quantity, CurrentPrice
Customer AccountNumber, Name, MobilePhone, HomePhone, EmailAddress,
Status
InventoryItemID, ProductItemID, Size, Color, Options,
InventoryItem QuantityOnHand, AverageCost, ReorderQuantity
OnlineCart OnlineCartID, CustomerAccountID, StartDateTime, NumberOfItems,
ValueOfItems, Status, ElapsedTime, HoldForDays
ActiveCart OnlineCartID, ElapsedTime

OnReserveCart OnlineCartID, HoldForDays

ProductComment ProductCommentID, ProductItemID, CustomerAccountNumber, Date,


Rating, Comment

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 28
Final Tables: Specialized subclasses as separate
tables (2 of 2)
Table Attributes
ProductItem ProductItemID, Gender, Description, Supplier, Manufacturer, Picture
PromoOffering PromotionID, ProductItemID, RegularPrice, PromoPrice
Promotion PromotionID, Season, Year, Description, StartDate, EndDate
Sale SaleID, CustomerAccountNumber, SaleDateTime, PriorityCode,
ShippingAndHandling, Tax, TotalAmount, MountainBucks
InStoreSale SaleID, StoreID, RegisterID, ClerkID
OnlineSale SaleID, TimeOnSite, ChatUse
TelephoneSale SaleID, ClerkID, LengthOfCall
SaleItem InventoryItemID, SaleID, Quantity, SoldPrice, ShipStatus, BackOrderStatus
SaleTransaction SaleTransactionID, SaleID, Date, TransactionType, Amount,
PaymentMethod

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 29
Designing Relational Databases:
Referential Integrity and Schema Quality

Referential integrity -- a consistent state among foreign


key and primary key values
Referential integrity constraint -- a constraint, stored in
the schema, that the DBMS uses to automatically
enforce referential integrity

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 30
Designing Relational Databases:
Referential Integrity and Normalization

A normalized relational database schema has these


features:
Flexibility or ease of implementing future data model changes
Lack of redundant data
Protects against insertion, deletion and update anomolies
Normalization -- a formal technique for evaluating and
improving the quality of a relational database schema
First Normal Form –
Second Normal Form –
Third Normal Form –

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights
reserved. 31
Data Types
The data type defines the storage format and
allowable content of an attribute (field)
Primitive data types – data types supported directly
by the DBMS
Complex data types – combinations or
compositions of primitive data types. User defined

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 32
Standard Primitive Data Types
Type(s) Description
datetimeoffset Date, time, and time zone
int, small int, and bigint Whole numeric values
float and real Numeric values with fractional quantities
money Currency values and related symbols (e.g., $ and €)
nchar and nvarchar Fixed- and variable-length Unicode string
varbinary Variable-length byte sequence up to 2GB
xml XML document up to 2GB

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 33
Distributed Database Architectures
Decentralized database is stored at many locations
but not requiring interconnectivity or
synchronization
Homogeneous distributed database is stored at
multiple locations, with all locations using the same
DBMS. Coordinated with a global schema
Heterogeneous distribute database is stored at
multiple locations and with different DBMS and
may have local schemas.

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 34
Homogeneous Distributed Database
Access is through a common DBMS and schema

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 35
Heterogeneous Distributed Database
Access is through
distinct DBMSs. May
have global and local
schemas in operation

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 36
Protecting the Database (1 of 2)
Transaction Logging – a technique to record all
updates including change, date, time, user
Helps to prevent fraud
Recovery mechanism for failures

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 37
Protecting the Database (2 of 2)
Concurrency and Update Controls
Transaction – a piece of work with several steps,
either all must complete or none must be accepted
Database lock – technique to apply exclusive
control to a portion of the database to one user at
a time
Shared or read lock – a lock where multiple
transactions (users) may read the data
Exclusive or write lock – a lock where only one
transaction (user) may access the locked portion of
the database

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 38
Summary
Most modern information systems store data and access
data using a database management systems (DBMS)
The most common database model is a relational database
(RDBMS), which is a collection of data stored in tables
The relational database schema is developed based on the
domain model class diagram Each class is represented as a
table. One to many associations are represented by adding
foreign keys
Normalization is the process to produce high-quality
databases without update, insertion or delete anomalies
Distributed databases are necessary for very large
databases
Database locks permit concurrent use of databases

Systems Analysis and Design in a Changing World, 7th Edition - Chapter 9 ©2016. Cengage Learning. All rights reserved. 39

You might also like