1 / 29

Data Modeling and the Entity-Relationship Model The Heather Sweeney Design Example

CSCI260 Database Applications. Data Modeling and the Entity-Relationship Model The Heather Sweeney Design Example. Chapter Four. About the business. Heather Sweeny is an interior decorator. Specializes in home kitchen design. Offers seminars at home shows and appliance stores.

peckham
Download Presentation

Data Modeling and the Entity-Relationship Model The Heather Sweeney Design Example

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSCI260 Database Applications Data Modeling and theEntity-Relationship ModelThe Heather Sweeney Design Example Chapter Four

  2. About the business • Heather Sweeny is an interior decorator. • Specializes in home kitchen design. • Offers seminars at home shows and appliance stores. • Seminars are free – used to build customer base, sell products and consulting services.

  3. About the business • After someone attends seminar, Heather wants to sell that person a product or service. • Wants to develop database to keep track of customers, the seminars they have attended, and the purchases they have made.

  4. The Seminar Customer List • Each seminar has a list of customers that attend it. • Includes basic data about seminar as well as the attendees.

  5. The Seminar Customer List • Two potential entities: SEMINAR and CUSTOMER. • From list, it looks like a SEMINAR relates to many CUSTOMERs. • There are facts missing, but we can still create an initial E-R Diagram.

  6. The Seminar Customer List • Customers can attend as many seminars as they wish. • Actually they do not need to attend seminar to get into database. • She never offers a seminar to fewer than 10 attendees. • Add more data to E-R Diagram…

  7. The Seminar Customer List • Need to be able to add seminar to database, whether it has customers or not. • Need to assign identifiers. • SEMINAR – surrogate key (instead of really large composite key) • CUSTOMER – email address

  8. Customer Form Letter • Heather sends a form letter to all attendees. • Several different letters… form letter 1, form letter 2, form letter 3, etc… • Wants to be able to send emails as well

  9. Customer Form Letter • Create entity CONTACT • ContactNumber – which form letter. • ContactType – form letter or email. • Relates to both Customers and Seminars. • Seminar can result in many contacts. • Customer may receive many contacts. • Neither a customer nor a seminar need to generate a contact.

  10. Customer Form Letter • Can a Contact exist without a seminar? yes. • Can a contact exist without a customer? No. • CONTACT is a weak entity depending on CUSTOMER. • ID-Dependant – the identifier of CONTACT includes the identifier of CUSTOMER.

  11. Customer Form Letter • Heather never contacts a customer more than once in any particular day. • Date can be identifier for CONTACT. • Problem – form letter needs customer’s address, but it isn’t in the CUSTOMER entity. Must be added.

  12. Sales Invoice • Used to sell books and videos. • Doesn’t record credit card numbers in database, just payment type.

  13. Sales Invoice • INVOICE needs to be entity. • Should not contain Customer information – keep that in CUSTOMER entity. • Still data missing about some of the lines on the invoice form.

  14. Sales Invoice • There are multiple line-items in the invoice – cannot store in INVOICE entity. • Create weak entity LINE-ITEM to store each line then relate back to INVOICE entity.

  15. Sales Invoice • LINE-ITEM needs an identifier. LineNumber. • The products sold have standardized names and prices. Create PRODUCT entry and relate it to LINE-ITEM.

  16. Sales Invoice • Note UnitPrice appears in both LINE-ITEM and PRODUCT. • Want to be able to update price of product without effecting past INVOICES. • When Invoice created, the UnitPrice is copied from the PRODUCT entity to the LINE-ITEM entity. Down the road, if price of product goes up, it won’t change the past INVOICES.

More Related