Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Problem No. 3
ShopNSaveisamailorderfirm.Itisamoderatesizedfirmcompetingwithlargerfirmsformailorder business.WhileShopNSavesellsmanyproducts,thefirmdoesnotproduceanyoftheproductssold; rather, the firm purchase products from wholesale distributors, have its label affixed to the products, andretailtheproductstocustomers. ShopNSave Pvt. Ltd is in the process of reengineering the automated order entry and product inventory management system. Your task is to use the Entity Relationship Model to develop a conceptual model of this system. Your eventual product is a model diagram of the system (for this assignmentonly)andalistoftablesandthefieldsinthetables(nextphase). CustomerTracking ShopNSavemaintainsanextensiveclientbase.IfyoueverpurchasedanythingfromShopNSave,you are almost guaranteed to be a lifetime customer of the firm. ShopNSave issues customers a credit cardwithauniquecustomeridentificationnumberassignedtoeachcustomer.Eachcreditcardhasan expirationdate,butifacustomermaintainsagoodcreditstanding,thefirmautomaticallyreissuesthe carduponexpiration.Thecreditcardservestoidentifythecustomer. The firm tracks each customers name, current address (including street, city, state, and zip code), current home telephone number, alternative telephone number (such as a work telephone number), emailaddress(ifthecustomerhasone),creditrating(acodedfieldrangingfrom1to5with1beingthe bestand5beingtheworst),creditcardexpirationdate,currentaccountbalance(thismaybenegative orpositive),creditbalancelimit(somepositivenumber),andthedateanorderwaslastplacedwiththe firm. SalesOrderProcessing Customersmaketelephonicordersbyusingtheircreditcardnumber.Typicalordersincludemorethan oneproductonanorder;forexample,acustomermayorderawasherandadryerbytelephoneonthe same order. Some orders have 50 items or more, but most orders have only a few items, sometimes only one item on an order. It is possible for customers to have several orders outstanding simultaneously.Itisalsopossibleforcustomerstohavenoordersoutstandingatapointintime. Orders are identified by ShopNSave as belonging to a single customer by their customer number (credit card number). A typical order is depicted in Figure #1. Order delivery is promised on a date agreed upon with the customer. Each order is uniquely identified by the combination of the order number and order date. The extended price field is computed as the product price times quantity ordered.HeretheproductpriceistheagreeduponpricesinceaShopNSavesalespersonmayoverride theregularpriceforanitemsoastocompleteasalethatmightotherwisebelost.
Figure#1.TypicalCustomerOrder.
DeliverPromisedon:12/08/2004 Salesperson:Zone3,ID12389
Price
Quantity Ordered
2345 2367
FlashDishWasher LuxBeautySoap
Rs.208.00 Rs.22.00
1 4
Notethatproductsmaybeorderedbymanydifferentcustomers,e.g.severaldifferentcustomersmay orderproduct#5672.Someproductsmaynotappearonanyorderthesearethe"dogs"sincenobody wantstobuythem.PeriodicallyShopNSavehasasalethatisannouncedbyaspecialmailingto customersinordertoclearinventoryof"dog"products. ShopNSavemaintainsamailordercataloglistingallproductsincludingapictureoftheproductfor manyproducts.Thefirmtrackseachproductsidentificationnumber(whichisassignedbythefirmand isunique),productdescription,anddesiredprice.Notethatthisisdifferentfromthenegotiatedprice thatappearsontheorder(eventhoughthecolumnheadingontheorderislabeledPrice,thisisstillthe negotiatedpriceforthatspecificorder). Inordertoexpeditecertainsearchesofthedatabase,itisrecommendedthattheordersubtotaland ordertotalbestored(eventhoughthetotalamountcanbecomputed).Theextendedpriceonan individuallineandtheorderdiscountneednotbestoredasthesefigurescanbecomputedeasily wheneveraviewofthedatabaseisdefined.Itisalsonecessarytotrackthequantityorderedforeach productonanorder.
DeliverytoCustomers Deliveryofproductsonanordertoacustomerisactuallyfairlycomplextotrack.First,thefirmtracks theactualdateofdeliveryofanordersoastosupportperiodassessmentsofthefirmsservicequality. Sometimesallitemsonanorderarenotdeliveredonthesamedate,i.e.,someitemsarebackordered forthecustomer;thus,itisnecessarytotrackthedeliverydateonanitembyitembasis.Thefirmwants thecomputersystemtogenerateauniquedeliverynumberforeachdelivery. Infact,thisexplanationisoversimplifiedforsomeorders.Whereanindividuallineitemquantityis greaterthanone,itispossibleforthefirmtodeliverpartofalineitemquantityinonedeliveryandpart inanotherdelivery.Figure#1showsacustomerwhohasorderedfoureachofproduct#563672,Chair, w/oarms.IfShopNSavehasthreechairsinstockatawarehouse,thechairsinstockwillbedelivered tothecustomerandonechairwillbebackorderedpendingreceiptofachairfromavendorsupplier.In fact,ifShopNSavehasthreechairsatonewarehouseandafourthchairatanotherwarehouse,the customerwillactuallyreceivetwoseparatedeliveriesofchairsonefromeachwarehouse.Inthis situation,itisnecessarytotrackthedateofeachdeliveryofalineitembyquantity.Anappropriate modelingapproachistocreateaDeliveryToCustomerentitythatcanbeusedtostoredataabouteach delivery. Vendors,ProductTracking,andWarehouses ShopNSavehasnumerouswholesalevendorswhosupplyproductsforresale.Eachvendorhasa uniquevendoridentificationnumberassignedbyShopNSave,eachvendorhasmanydifferentvendor salespersonswhomaycontactShopNSave.Itisnecessarytotrackeachofthesevendorsalespersons namesandtheirworktelephonenumber.ShopNSavealsotracksthenameoftheprimarycontact personforeachvendor,andthecontactpersonsindividualworktelephonenumberintheeventthata problemwithawholesalepurchaseorderarisesthatneedstoberesolvedwhentheoriginalsalesperson isunavailable. Notallvendorssupplyallproducts,butmostproductsaresuppliedbymorethanonevendor.Since ShopNSavedoesnotmanufacturetheirownproductseverythingispurchasedforresaleitis importanttobeabletotrackthetypicalpricesthateachvendortendstoquoteforanitem.For example,product#415672thatShopNSavesellsisavailablefromtheABCFurnitureCompanyfora wholesalepriceofRs.238.45/=ThesametablecanbepurchasedfromtheXYZFurnitureCompanyfora wholesalepriceofRs.245.90.ShopNSavepreviouslymaintainedacatalogbookofavailableitemsfor eachvendor,butwithsome2500vendors,itismuchmoreefficienttohaveproductinformationonline asthisenablesproductpricecomparisonsbypurchasingclerkswhoarecontractingwithvendorsfor stockageitems. Someproductsrequirespecialhandlingandspecialstorage.Inadditiontotheproductattributesnoted above,itisnecessarytotrackspecialhandlingandspecialstoragenotesforeachproductwiththese requirements.Specialhandlingandspecialstoragerequirementsarebothstoredascodedfieldsinthe
currentsystem,andShopNSavewishestocontinuethispractice.Currentlytwotablesexistthatstore thefulldescriptionofthespecialhandlingorspecialstoragerequirementthatisassociatedwithan individualcode. ShopNSavehasasinglesalesorderprocessingfacilityaswellas465warehousefacilitieslocated throughoutthecountry.Eachwarehousehasauniquewarehousenumberassignedtoit,butworkers tendtorefertothewarehousesbythecityinwhichtheyarestored,althoughsomecitieshavemore thanonewarehouse.Inadditiontotheidentifyingnumber,eachwarehousehasasingleaddress,city, state,andpostcode,andtelephonenumber. WheneverShopNSaveissuesapurchaseordertoreplenishwarehousestock,itisnecessarytotrack whichvendorisshippingtheordertoawarehouse.Itisalsonecessarytotracktheproductsthat comprisethepurchaseordersinceasinglepurchaseordercanbeformultipleproducts.Figure#2shows asamplepurchaseorder. TheseshipmentsrenewwarehouseinventorieswhichShopNSavemaintainsinordertofillcustomer ordersonatimelybasis.Inadditiontotheattributesmentionedpreviouslyforproductsandvendors, ShopNSaveassignsauniqueshipmentnumbertoeachshipment.Someshipmentsbyavendortoa warehouseconsistofmultipleproducts.Itisalsonecessarytotrackeachshipmentsshippingdate/time (date/timethevendorshipstheordertoShopNSave),thequantityofeachproductonashipmenttoa specificwarehouse,theestimatedshipmentarrivaldate,andtheshipmentmode(acodedattribute). Thefirmmustalsotrackthequantityactuallyonhand(instock)ofeachproductateachwarehouse,as wellasthequantitybackorderedthatisdueinasaresultofhavingissuedapurchaseordertoa vendor.
Figure#2.SamplePurchaseOrder.
ShopnSavePurchaseOrder
PurchaseOrderNo:5123345 PurchaseOrderDate:03/08/2004
Table,Walnut Chair,w/oarms
Rs.225.00 Rs.200.00
10 40
OrderTotal:
Rs.10,250.00
SalesStaff ShopNSavetracksinformationofitsemployees.Eachemployeehasaname,address,socialsecurity number,telephonenumber,salaryamount,anddateofbirth.Someemployeessuperviseother employees.Whileitisnecessarytotrackthesupervisorforagivenemployee,thereisnoadditional informationthatthefirmtracksforsupervisors.Someemployeesdonotsuperviseanyone.No employeehasmorethanonesupervisor.Thefirmalsotrackswhetherornotanemployeeworksata warehouseoratthefirmscentralsalesprocessingfacility. ReferagaintoFigure#1.Notethatthefirmtrackswhichsalesperson(atypeofemployee)makesasale toacustomer.Thisinformationmustalsobecapturedbecausethefirmintendstoinitiateasalesperson incentiveprograminthenearfuture.Currentlysalespersonsworkforastraightsalary,butinthefuture, salespersonswillbeonasalarypluscommission. InvoicingCustomers Inadditiontotheentitiesandobjectsnotedabove,itisnecessarytobeabletostoreinformationabout thecustomerinvoice.Youmaywishtodesignanappropriateinvoiceaspartoftheexercise;however,it willnotbegraded.Designingtheinvoicewillhelpyouvisualizethedatathatmustbestoredinorderto modeltheinvoicingpartofthesystem.ShopNSavebillscustomersonanorderbyorderbasis.The invoicewouldshowappropriateinvoicedatasothatthecustomer,theproductsorderedandtheir associatedordernumberandorderdate,thequantitiesorderedanddelivered(previouslyandonthis order),andthenegotiatedpricesareidentifiedontheinvoice.Theinvoicewouldalsoshowdiscounts given,anypreviouspaymentsmade,andtheamountdueonthisinvoice(IhavediscussedanInvoice exampleintheclassaswell).Notethatanindividualordercanresultinmultipleinvoicessincesome products may be backordered and delivered at a later date, and some customers have to be billed multiple times in order to get them to pay their bill. Each invoice would have a unique number assigned as well as an invoice date. Your final solution should also enable recording customer payments on an invoice. The system should also enable updating the customer's account balance.
NOTE: All these scenarios are imaginary and design to teach ER Modeling techniques. There are chances to suffer error of omission. If you can recommend ways to make the problem more realistic without being unnecessarily burdensome with respect to the learning that takes place, please put your recommendations in writing and I will consider awarding bonus points for your thoughts and effort. You can create your own case like this I will award bonus points for the same as well.