Upload
danika
View
33
Download
0
Tags:
Embed Size (px)
DESCRIPTION
MIS 2502. Decomposing BJ’s Wholesale club CJ Marselis. Business Rules. - PowerPoint PPT Presentation
Citation preview
Decomposing Barnes and Noble
Decomposing BJs Wholesale club
CJ MarselisMIS 2502
1Business RulesBJs is interested in developing a new application. The database will track product, customer, and sale information. It will also collect basic store information. The business rules are typical of most retail stores with the exception that sales are tracked to the customer since the customer is a member. The specific rules include:
A product may be supplied by multiple suppliersA manufacture produces many products but sells to clients through the supplierA sale to a store includes many productsA sale to a customer may include many productsThe sale to the customer includes the store number to facilitate returnsA store has only one managerAn employee can have only 1 position
A product may be supplied by multiple suppliersM:N relationship between Product and Suppliers
3A manufacture produces many products but sells to clients through the supplier
Lets consider the relationship between manufacturer and products firstWhile a product COULD be produced by many manufacturers, lets assume that this is not the case
A manufacture sells to clients through the supplierIn this case the client is the StoreBasically, we need a sale to show the purchase of the product from the manufacturer to the supplier BUT this is out of scope of this db. Since were building the DB for BJs and BJs wouldnt want to store the purchases of the products by the supplier from the manufacturer, we wont worry about this
A sale to a store from a supplier
Since BJs would want to know what products it ordered for each store from the suppliers, we need to house this information in our dbEssentially, this is just a sale!Remember all sales include the following components:CustomerSellerProductsGeneral Sale informationDetails about the sale
6SaleRemember all sales include the following components:SellerCustomerProductsSince the seller sells to multiple customers and a customer buys from multiple sellers, its a M:NEach time a customer buys stuff from a seller, its a sale Thats the bridge!In this case:Seller = Supplier Customer = StoreSale = delivery invoice
Delivery Invoice
The Delivery Invoice shows the M:N between Store and SupplierNeed FKs to Store and SupplierDeliver and order dateCould add employee that placed the order at the buyer. This will be FK to employee table
A sale to a store includes many products
The buyer can purchase many products in the sale. Since an invoice includes many products and a product can be sold in many invoices, its a M:N between an invoice and productNeed to show the FKs to the product and invoice tables
9The sale to the customer includes the store number to facilitate returns
Sale includes:Seller = StoreCustomer = CustomerSale = Sale
10Lets say we want to track which cashier rang up the sale. An employee can have only 1 position
Add cashier as FK to Employee Lookup
11A sale to a customer may include many products
Just like the invoice detail table, need a bridge between sale and products
12A store has only one manager
13Put it all together