Вы находитесь на странице: 1из 5

BMGT402

Spring 2013 Homework #4 - Entity-Relationship (ER) Model Due by 11:59pm, Wednesday, April 10th, 2013. Note: The file name must be renamed to yourLastName_yourFirstName_HW4.docx or yourLastName_yourFirstName_HW4.doc. If you choose to insert all screenshots into this document, you will submit only this file. If you choose to include other model files, you will need to compress multiple files into yourLastName_yourFirstName_HW4.zip for submission. Repeat steps below for the IT Training and the Video Rental designs. 1. Describe the ER schema: i. A list of entities, attributes, and primary keys. ii. A list of relationships (unary, binary, ternary, etc.) and attributes. iii. Multiplicity constraints (participation + cardinality) from business rules. 2. Represent the ER schema in the UML representation: i. Use ArgoUML, Microsoft Viso, yED or any other tool you can draw ER diagram. ii. Note that some business rules will not be captured in the model. If you find such rules, add a note in the model and write the rules in the note. Example: Publisher Ms. Contract would like you to design a conceptual schema for her agency using the entity- relationship model. She represents authors and publishing companies and helps them draw up contracts. I would like you to design a detailed ER schema as follows: Identify each entity, relationship between entities and all attributes. Identify the primary key for each entity and the minimum/maximum participation/cardinality for each relationship.

The business rules include: Each book is described by a unique ISBN, year of publication, sales price, and number of pages. Each author is described by a unique name and phone number. Each book is written by at least one authors. Because there can possibly be multiple authors for a book, this relationship is described by an attribute role; values are primary-author, editor, etc. Ms. Contract maintains author information even if they have not authored any book as yet. Each publishing company is identified by a unique name and phone number. Each book must be under-review by at least one publishing company, and this relationship is described by an expiration date. There are several editors who work for each publisher, and each publisher has at least one editor. However, editors are not independent of publishers. Therefore, each editor is identified by a combination of a unique name and the publisher name, and a phone number. For each book that is finally completed and published by a publisher, there is a single author who signs-a-contract for that book. There is an attribute date associated with each contract. Note that this is a ternary relationship. BMGT402 HW 4

Example Answers: 1. ER Schema: Entities, Attributes and Primary Keys Book: ISBN {PK}, pubYear, price, pages Author: aName {PK}, phoneNo Publisher: pName {PK}, phoneNo Editor: eName {PK}, phoneNo Relationships, Degrees and Participating Entities WrittenBy: (binary relationship: role) 1 Book to 1 or more Author 1 Author to 0 or more Books UnderReview: (binary relationship: expDate, -month, -day, -year) 1 Book to 1 or more Publisher 1 Publisher to 0 or more Books Note: Inferred so no limitation. WorksFor: (binary relationship) 1 Publisher to 1 or more Editors 1 Editor to 1 Publisher SignsAContract: (ternary relationship: date, -month, -day, -year) 1 Book and 1 Publisher to 1 Author 1 Author and 1 Book to 0 or 1 Publisher Note: Inferred by best judgment. 1 Author and 1 Publisher to 0 or more Books Note: Inferred so no limitation. 2. ER Diagram:

BMGT402 HW 4

IT Training IT Specialists is a company to provide IT training in programming, database development and Web applications. Business rules include: The company offers five technology courses. Each course is identified by a unique course number (cNo) and course name (cName). At least one and up to three sections of each course can be offered in each training period; this relationship is described by the training period (period). Each section is identified by a unique pair of course number (cNo) and section number (sNo), and a room location (room). Each section can enroll up to 100 trainees and a section much have at least 20 trainees to be offered. Each trainee is identified by a unique trainee number (tNo) and name (tName), and each trainee is restricted to enroll up to five sections of courses. The company has 30 instructors. Each instructor is identified by a unique number (iNo) and name (iName), and each instructor can be assigned to 0, 1 or 2 teaching teams. Each teaching team is identified by a unique number (mNo) and a team color (color), and consists of 2 to 4 instructors. Each section is taught by exactly one teaching team, and each teaching team teaches exactly one section. 1. ER Schema: Entities, Attributes and Primary Keys Course: cNo {PK}, cName Section: sNo {PPK}, room Note: Should not include cNo because no FK in ERD. Trainee: tNo {PK}, tName Instructor: iNo {PK}, iName TeachingTeam: mNo {PK}, color Relationships, Degrees and Participating Entities Offered: (binary relationship: period) 1 Course to 1-to-3 Sections 1 Section to 1 Course Enrolled: (binary relationship) 1 Section to 20-to-100 Trainees 1 Trainee to 0-to-5 Sections Assigned: (binary relationship) 1 Instructor to 0-to-2 TeachingTeams 1 TeachingTeam to 2-to-4 instructors TaughtBy: (binary relationship) 1 Section to 1 TeachingTeam 1 Teaching Team to 1 Section 2. ER Diagram: BMGT402 HW 4

Video Rental The manager of the StayHome Videos shop requires you to create a database application system to assist with the administration of the shop. The requirements collection and analysis phase has provided the following requirements for the database. The data stored on the videos for rent includes the video number, catalog number, title, category, certification, year of release, main actor/actress, purchase price, and daily rental rate. The video number is created by the manager and uniquely identifies each video. The total number of videos in stock should also be available. The video shop stocks videos that fall into the following categories - comedy, drama, horror, musical, science fiction, children and adults only. The data stored on each member of the video shop includes membership number, date joined (month, day, year), name (first and last name), address (street, city, state, zip code), and two telephone numbers. The total number of members should also be available. Each member may borrow an unlimited number of videos, with the checkout date (month, day, year) and return date (month, day, year) on each video. Data on suppliers of videos should also be stored, such as supplier number, name, address (street, city, state, zip code), and up to three telephone numbers. Data on the supply of the current stock of videos should be specifically noted. Additional data to be stored includes the quantity of each video supplied and the date (month, day, year) supplied. The video catalog number uniquely identifies each video and is used by suppliers in the provision of videos.

1. ER Schema: Entities, Attributes and Primary Keys

BMGT402 HW 4

Video: videoNo {PK}, catalogNo {AK}, title, certification, yearRelease, mainActorActress, purchasePrice, dailyRentalRate, /totalVideo Note: Should not include category nor categoryNo. Category: categoryNo {PK}, categoryText Member: memberNo {PK}, dateJoined, -month, -day, -year, name, -first, -last, address, -street, - city, -state, -zipcode, phoneNo [1..2], /totalMember Supplier: supplierNo {PK}, name, address, -street, -city, -state, -zipcode, phoneNo [1..3] Relationships, Degrees and Participating Entities Categoried: (binary relationship) 1 Video to 1 Category 1 Category to 0 or more Videos Rented: (binary relationship: checkoutDate, -cMonth, -cDay, -cYear, returnDate, -rMonth, -rDay, -rYear) 1 Member to 0 or more Videos 1 Video to 0 or 1 Member Supplied: (binary relationship: quantity, date, -month, -day, -year) 1 Video to 1 Supplier 1 Supplier to 0 or more Videos 2. ER Diagram:

BMGT402 HW 4

Вам также может понравиться