BCIS 4660 Sample Solutions Homework #4

BCIS 4660
Sample Solutions Homework #4
Chapters 5 & 6 Pratt & Adamski
Exercise #4
Due: Sep 30 (Tues)/ Oct 2 (Thur)
Points: 20 points
Pratt & Adamski (End of Chapters 5 & 6)
Assignments must have Cover sheet/Table of contents
and be stapled.
• Chapter 5 [pp 180-181; 7th Ed]: Answer questions 1, 2,
3 for Premiere Products and questions 2, 4 for Henry
Books.
•
•
•
•
– Functional Dependency “diagrams/charts” &
– Turn in DBDL (i.e., Relations Lists)
• Chapter 6 pp 226-7; 7th Ed]: Answer questions 2, 4 for
Premiere Products and questions 1, 2, 3 for Henry
Books.
– Turn in DBDL (i.e., Relations Lists) &
– ERDs (i.e., Relationship Diagrams)
NAME_________________________
BCIS 4660 Database Warehouse Concepts
(20 Points)
Homework Assignment #4 Score sheet
Assignment
Appearance
__ Name on Cover page
__ Table of Contents
__ Overall appearance
+ВЅ
+ВЅ
+ВЅ
Problem Number
Functional Dependencies
(1 point per question)
+ ВЅ determinants
+ ВЅ attributes/properties;
3NF Tables
(1 point per
question)
Or Relations
+ ВЅ each;
PP 5-1
PP 5-2
PP 5-3
HB 5-2
HB 5-4
Chapter 5
PP 6-2
PP 6-4
HB 6-1
HB 6-2
HB 6-3
Chapter 6
SUBTOTAL
Maximum
DBDLs or Relation Lists
(1 pt per question)
ERDs;
(1 pt each)
SUBTOTAL
MAX. TOTAL
Concepts of Database
Management, 7th Edition,
Pratt & Adamski
Maximum
SCORE
/-1
/2
/2
/2
/2
/2
/10
/2
/2
/2
/2
/2
/10
/20
Student Requirements
As per the Grading Form above, students will need
to produce the following type of OUTCOMES:
1. Functional Dependency formulas or diagram
2. Relation Lists
3. ERD/Relationship Diagrams
Examples of all 3 follow below.
Generally students will use the Functional
dependencies to construct GOOD relations. Then
create an ERD for the database.
Functional Dependency Diagram for Orders
w/ Sample Functional Dependency Notation
Functional Dependency Diagram:
Good functional dependency on top
Bad functional dependency on bottom
This is the Functional Dependence Notation used in class (All final tables
Must be in at least 3rd Normal Form:
Unnormalized 2NF Table ORDERS
Primary Key: (OrderNum, PartNum)
F(OrderNum) пѓ OrderDate
F(PartNum) пѓ Description
Concepts of Database
Management, 7th Edition,
Pratt & Adamski
Chapter 5: Sample Answer #4-1
Functional Dependencies:
P&A Notation:
This is the Functional Dependence
Notation used in class (All final tables
Must be in at least 3rd Normal Form:
Primary Key: (OrderNum, PartNum)
F(OrderNum, PartNum) пѓЁ NumOrdered,
QuotedPrice
2NF anomalies resolved:
F(OrderNum) пѓ OrderDate
F(PartNum) пѓ Description
Relation Listing:
ORDER[ OrderNum, OrderDate]
ORDER_DETAIL[OrderNum,
Partnum, NumOrdered,
QuotedPrice]
PART[PartNum, Description]
NOTE: All columns accounted for
in example.
SAMPLE Relation List: REP table; CUSTOMER
table
Note: REP & CUSTOMER Relations:
REP [RepNum, LastName, FirstName, Street,
City, State, Zip, Commission, Rate]
CUSTOMER[CustNum, CustLastName, CustFirstName,
…, RepNum]
Primary Keys: Bold and Underlined
Foreign Keys: Italicized and Bold
Concepts of Database
Management, 7th Edition,
Pratt & Adamski
Another Example
of
Functional
Dependencies
for HOLT Industries
Concepts of Database
Management, 7th Edition,
Pratt & Adamski
Tentative List of Entities/Relations
HOLT INDUSTRIES EXAMPLE
Expand into relations
See next page.
Concepts of Database
Management, 7th Edition,
Pratt & Adamski
SAMPLE List of
Functional Dependencies
w/ RELATIONS
CUSTOMER [CustomerNumber, SoldToName, SoldToAddr1,
SoldToAddr2, SoldToCity, SoldToState, SoldToZip,
RepNum]
REP[RepNum, RepLastName, RepFirstName]
PART [ItemNum, ItemDesc, ItemPrice]
INVOICE [InvoiceNo, InvDate, OrderNum, ShipDate, Frieght,
InvTotal]
Order [OrderNo, OrderDate, PONum, CustNoShipToNum,
ShipToName, ShipToAddr1, SoldToAddr2, ShipToCity,
SoldToState, ShipToZip ]
OrderLine [OrderNum, ItemNum, QuantityOrdered,
QuantityShipped, QuantityBO, ItemPrice]
Concepts of Database
Management, 7th Edition,
Pratt & Adamski
Complete ERD Diagram;
Students should use ACCESS Relationship Diagram Tool
Or ERDPlus Software (ERD option)
NOT necessary to show Property
Ovals on Relationship Diagram.
Also, an Intersection table will be
Used instead of the Relationship
Box shown for OrderLine.
Concepts of Database
Management, 7th Edition,
Pratt & Adamski
PP 6-2.b
ERD/Relationship Diagram
Before: RepNum in Customer
ERD/Relationship Diagram
After: RepNum In ORDERS
PP 6-2.b ALTER Relationships
ERD Plus; Repnum in
Customer
ERD Plus; Repnum in Orders
NAME_________________________
BCIS 4660 Database Warehouse Concepts
(20 Points)
Homework Assignment #4 Score sheet
Assignment
Appearance
__ Name on Cover page
__ Table of Contents
__ Overall appearance
+ВЅ
+ВЅ
+ВЅ
Problem Number
Functional Dependencies
(1 point per question)
+ ВЅ determinants
+ ВЅ attributes/properties;
3NF Tables
(1 point per
question)
Or Relations
+ ВЅ each;
PP 5-1
PP 5-2
PP 5-3
HB 5-2
HB 5-4
Chapter 5
PP 6-2
PP 6-4
HB 6-1
HB 6-2
HB 6-3
Chapter 6
SUBTOTAL
Maximum
DBDLs or Relation Lists
(1 pt per question)
ERDs;
(1 pt each)
SUBTOTAL
MAX. TOTAL
Concepts of Database
Management, 7th Edition,
Pratt & Adamski
Maximum
SCORE
/-1
/2
/2
/2
/2
/2
/10
/2
/2
/2
/2
/2
/10
/20