Presentation on theme: "Exercise 1 Consider the ER diagram below. Assume that an employee may work in up to two departments or may not be assigned to any department. Assume that."— Presentation transcript:
1Exercise 1Consider the ER diagram below. Assume that an employee may workin up to two departments or may not be assigned to any department.Assume that each department must have one and may have up to three phone numbers. Supply (min, max) constraints on this diagram.State clearly any additional assumptions you make.WORKS-INEMPLOYEEDEPARTMENTHAS-PHONECONTAINSPHONE
2Exercise 2For each of the following pairs of rules, draw an ER diagram showing the cardinality and participation constraints:A doctor may treat many patients. A patient may have a designated or (treated by ) doctors for different types of problems.A hospital has many patient rooms. Each patient room belongs tothat hospital.An author may write many books. A book written by morethan one author.
3Exercise 3Identify the entities and relationships for the following descriptionand draw an ER diagram.Persons subscribe to various journals.Each journal has a set of numbered volumes,and each of volumes has a set of numbered issues.Persons, described by their name, SSN, and address.journal, identified by a title and an ISBN.Subscribers have an initial subscription date and a termination date for each journal to which they subscribe..
4Exercise 4Identify the entities and relationships for the following descriptionand draw an ER diagram.A library system contains libraries, books, authors and patrons, withidentifying attributes library Number, book number, author number,and patron number, respectively. Libraries are further described by alibrary name and location, books by title and page count, authors byauthor name, and patrons by patron name and. Libraries hold numerous books (some with multiple copies), each authored byone or more authors. Patrons borrow books, but at any point in time,may not have anything checked out. When they do have a bookchecked out, there is a due date associated with it.
5Exercise 5Identify the entities and relationships for the following descriptionand draw an ER diagram.Departments, identified by ID, operate a variety of printers, eachlocated in a particular room in a particular building.Printers are supplied by a number of suppliers, identified by name, with each supplier charging a different price for a given printer, but alsoproviding different delivery delays, measured in days. A given roomcan have any number of printers, including none.
6Exercise 6A loan company wants to design a database to track student loans.Each student attending school is eligible for a loan. A student mayhave more than one loan. A student may be registered, possibly atdifferent times, in more than one school. Each loan should belong toonly one bank. Each bank can approve as many loans as it desires. For each loan, the loan company will track: the student’s SSN, name,address, amount of loan, date of loan, interest rate ( which may bedifferent for each loan as determined by the bank), duration of loan,monthly payment, remaining balance, school ID, school name andaddress, number of years the student has been at the school, bankname, bank branch and bank ID.Draw an ER diagram.State any assumptions you make in the diagram.