33% found this document useful (3 votes)
2K views

Week 3 Written Assignment

The Queen Anne Curiosity Shop wants to modify its database to improve inventory tracking and simplify customer and employee data storage. The modifications include: 1) Allowing inventory quantities to be tracked at the item level rather than unique item instances. 2) Tracking order quantities, costs, and vendors for inventory. 3) Storing customer and employee data in a unified person table with subtypes for roles. 4) Collecting additional customer payment details and employee employment dates.

Uploaded by

jay
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
33% found this document useful (3 votes)
2K views

Week 3 Written Assignment

The Queen Anne Curiosity Shop wants to modify its database to improve inventory tracking and simplify customer and employee data storage. The modifications include: 1) Allowing inventory quantities to be tracked at the item level rather than unique item instances. 2) Tracking order quantities, costs, and vendors for inventory. 3) Storing customer and employee data in a unified person table with subtypes for roles. 4) Collecting additional customer payment details and employee employment dates.

Uploaded by

jay
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

1 | Page

The Queen Anne Curiosity Shop wants to expand its database applications beyond the current recording of
sales. The company still wants to maintain data on customers, employees, vendors, sales, and items, but it
wants to (a) modify the way it handles inventory, and (b) simplify the storage of customer and employee data.

Currently, each item is considered unique, which means that the item must be sold as a whole, and
that multiple units of the item in stock must be treated as separate items in the ITEM table.

The Queen Anne Curiosity Shop management wants the database modified to include an inventory
system that will allow multiple units of an item to be stored under one ItemID.

The system should allow for a quantity on hand, a quantity on order, and an order due date. If the
identical item is stocked by multiple vendors, the item should be orderable from any of these
vendors.

The SALE_ITEM table should then include Quantity and ExtendedPrice columns to allow for sales
of multiple units of an item.

Some of the fields in CUSTOMER and EMPLOYEE store similar data. Under the current system,
when an employee buys something at the store, his or her data has to be reentered into the
CUSTOMER table. The managers would like to have the CUSTOMER and EMPLOYEE tables
redesigned using subtypes.

For this assignment use the following Queen Anne Curiosity Shop database
schema from chapter 3
CUSTOMER (CustomerID, LastName, FirstName, Address, City, State, ZIP, Phone, Email)
EMPLOYEE (EmployeeID, LastName, FirstName, Phone, Email)
VENDOR (VendorID, CompanyName, ContactLastName, ContactFirstName,
Address, City, State, ZIP, Phone, Fax, Email)
ITEM (ItemID, ItemDescription, PurchaseDate, ItemCost, ItemPrice, VendorID)
SALE (SaleID, CustomerID, EmployeeID, SaleDate, SubTotal, Tax, Total)
SALE_ITEM (SaleID, SaleItemID, ItemID)
REMEMBER: Foreign keys, in italic, are not listed in a table when drawing an E-R data model
Use the tools below to create the E-R diagram as demonstrated in class.

The only MAX Cardinality are 1:1 and 1:N.


1 for One and N for Many(Think No-limit)
The only MIN Cardinality are M:M and M:O.
M for Mandatory and O for Optional
The direction of the relationship does not matter
When you have an arrow selected you can use the FORMAT Tab to Rotate it.

2 | Page

A.

(10 points) Draw an E-R data model for the Queen Anne Curiosity Shop database schema shown on
page 1. Use the IE Crows Foot E-R model for your E-R diagrams. Justify the decisions you make
regarding minimum and maximum cardinality.

Use this chart for Part A


RELATIONSHIP
PARENT

CARDINALITY

CHILD

TYPE

MAX

MIN

CUSTOMER

SALE

Strong Type

1:N

M-O

EMPLOYEE

SALE

Strong Type

1:N

M-O

SALE

SALE_ITEM

Id Dependent Type

1:N

M-M

ITEM

SALE_ITEM

Strong Type

1:1

M-O

VENDOR

ITEM

Strong Type

1:N

M-O

_ CUSTOMER _ (Must/May) have a(n) _X_


_X_ (Must/May) have a(n) _ CUSTOMER _

_ CUSTOMER _ can have (One/Many) _X_


_X_ can have (One/Many) _ CUSTOMER _

_ EMPLOYEE _ (Must/May) have a(n) _X_


_X_ (Must/May) have a(n) _ EMPLOYEE _

_ EMPLOYEE _ can have (One/Many) _X_


_X_ can have (One/Many) _ EMPLOYEE _

_ SALE _ (Must/May) have a(n) _X_


_X_ (Must/May) have a(n) _ SALE _

_ SALE _ can have (One/Many) _X_


_X_ can have (One/Many) _ SALE _

_ ITEM _ (Must/May) have a(n) _X_


_X_ (Must/May) have a(n) _ ITEM _

_ ITEM _ can have (One/Many) _X_


_X_ can have (One/Many) _ ITEM _

_ VENDOR _ (Must/May) have a(n) _X_


_X_ (Must/May) have a(n) _ VENDOR _

_ VENDOR _ can have (One/Many) _X_


_X_ can have (One/Many) _ VENDOR _

3 | Page

SaleID

LastName
FirstName
Phone
Email

SaleDate
SubTotal
Tax
Total

CUSTOMER

EMPLOYEE

SALE

EmployeeID

CustomerID
LastName
FirstName
Address
City
State
ZIP
Phone
Email

SALE_ITEM
SaleID
SaleItemID

VENDOR
VendorID
ITEM
ItemID
ItemDescription
PurchaseDate
ItemCost
ItemPrice

CompanyName
ContactLastName
ContactFirstName
Address
City
State
ZIP
Phone
Fax
Email

4 | Page

B.

(10 points) Extend and modify the E-R data model by adding only the Queen Anne Curiosity Shops
inventory system requirements. Use the IE Crows Foot E-R model for your E-R diagrams. Create
appropriate identifiers and attributes for each entity. Justify the decisions you make regarding minimum
and maximum cardinality.
1. When an Item is purchased from a Vendor they get an Order receipt.
2. Record the date when an Order is made and when the Order is received.
3. Record the original cost of a single item on the Order.
4. Store how many items were purchased on the Order.
5. Each order has a subtotal of the items, how much tax was applied and the total cost of
each Order.
6. Eliminate redundant information from the Item model in part A.
7. Add the ability to track what is on-hand and what is on-order in the Item model.
8. Sale_Items can now have a quantity and an extended price.

Use this chart for Part B


RELATIONSHIP
PARENT

CHILD

CARDINALITY
TYPE

ITEM

SALE_ITEM

Strong type

ITEM

ORDER

Strong type

VENDOR

ORDER

Strong type

MAX

_ ITEM _ (Must/May) have a(n) _X_


_X_ (Must/May) have a(n) _ ITEM _

_ ITEM _ can have (One/Many) _X_


_X_ can have (One/Many) _ ITEM _

_ ITEM _ (Must/May) have a(n) _X_


_X_ (Must/May) have a(n) _ ITEM _

_ ITEM _ can have (One/Many) _X_


_X_ can have (One/Many) _ ITEM _

_ VENDOR _ (Must/May) have a(n) _X_


_X_ (Must/May) have a(n) _ VENDOR _

_ VENDOR _ can have (One/Many) _X_


_X_ can have (One/Many) _ VENDOR _

MIN

5 | Page

CUSTOMER

SALE

EMPLOYEE

CustomerID

SaleID

EmployeeID

LastName
FirstName
Address
City
State
ZIP
Phone
Email

SaleDate
SubTotal
Tax
Total

LastName
FirstName
Phone
Email

VENDOR

SALE_ITEM

VendorID

SaleID
SaleItemID

CompanyName
ContactLastName
ContactFirstName
Address
City
State
ZIP
Phone
Fax
Email

Quantity
ItemPrice

ITEM
ItemID

ORDER
InvoiceNumber
DateOrdered
DateRecieved
QuantityOrdered
ItemCost
OrderSubTotal
OrderTax
OrderTotalCost

ItemDescription
RecorderPointQuantity
QuanityOnHand
ItemPrice

6 | Page

C.

(10 points) Extend and modify the E-R data model by adding only the Queen Anne Curiosity Shops
need for more efficient storage of CUSTOMER and EMPLOYEE data. Use the IE Crows Foot E-R
model for your E-R diagrams. Create appropriate identifiers and attributes for each entity. Justify the
decisions you make regarding minimum and maximum cardinality.
1. A Person can be a Customer or Employee or both.
2. A Person has all of information from the Customer model Part A.
3. Customer and Employee are subtypes of a Person.
4. Store the card type, card number and expiration date of the credit card a Customers
uses.
5. Keep track of when an Employee is hired and their rate of pay.
6. Use the primary key of the supertype for each subtype.
7.

Use this chart for Part C


RELATIONSHIP
PARENT

CHILD

CARDINALITY
TYPE

MAX

MIN

PERSON

CUSTOMER

Id Dependent Inclusive Subtype

1:N

M-O

PERSON

EMPLOYEE

Id Dependent Inclusive Subtype

1:N

M-O

_ PERSON _ (Must/May) be a(n) _X_


_X_ (Must/May) have a(n) _ PERSON _

_ PERSON _ can be (One/Many) _X_


_X_ can be (One/Many) _ PERSON _

_ PERSON _ (Must/May) be a(n) _X_


_X_ (Must/May) be a(n) _ PERSON _

_ PERSON _ can be (One/Many) _X_


_X_ can be (One/Many) _ PERSON _

7 | Page

PERSON
PersonID
IsEmployee
IsCustomer
LastName
FirstName
Address
City
State
Zip
Phone
Email

SALE
SaleID
CUSTOMER

SALE_ITEM
SaleItemID
ItemPrice

VENDOR
VendorID

ITEM

CompanyName
ContactLastName
ContactFirstName
Address
City
State
ZIP
Phone
Fax
Email

ItemID
ItemDescription
PurchaseDate
ItemCost
ItemPrice

EMPLOYEE

CreditCardType
CreditCardNumber
CreditCardExpiratioDate

SaleDate
SubTotal
Tax
Total

DateOfHrs
HourlyPayRate

8 | Page

D.

(10 points) Combine the E-R data models from parts B and C to meet all the Queen Anne Curiosity
Shops new requirements, making additional modifications, as needed. Use the IE Crows Foot E-R
model for your E-R diagrams.
PERSON
PersonID
IsEmployee
IsCustomer
LastName
FirstName
Address
City
State
Zip
Phone
Email

CUSTOMER
SALE

CreditCardType
CreditCardNumber
CreditCardExpiratioDate

EMPLOYEE

PERSONID

SaleID

PersonID

SaleDate
SubTotal
Tax
Total

DateOfHrs
HourlyPayRate

VENDOR
VendorID

SALE_ITEM

CompanyName
ContactLastName
ContactFirstName
Address
City
State
ZIP
Phone
Fax
Email

SAleID
SaleItemId
Quantity
ItemPrice

ORDER
InvoiceNumber

ITEM

DateOrdered
DateRecieved
QuantityOrdered
ItemCost
OrderSubTotal
OrderTax
OrderTotalCost

ItemID
ItemDescription
ReorderPointQuanity
QuantityOnHand
ItemPrice

You might also like