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

ERD Exercises

1. Company Employees A company has a number of employees, identified by Employee Numbers. The company wants to keep track of the employees names, addresses and ages. The company also has several projects. Projects are assigned a unique project identifier, and also have the attributes project name and start date. Each employee may be assigned to one or more projects, or may not be assigned to any projects. A project must have at least one employee assigned to it, and may have any number of employees assigned. An employees billing rate depends on the project he or she is assigned to. The company wishes to keep track of the employees billing rates on every project, and when the employees started to work on their projects. 2. Courses A university has a large number of courses in its catalog. Attributes of Course include Course_Number (identifier), Course_Name, and Credits. Each course may have one or more different courses as prerequisites, or may have no prerequisites. Similarly, a particular course maybe a prerequisite for any number of courses. 3. Laboratory A laboratory has several chemists who work on one or more projects. Chemists also may use certain types of equipment on each project. Attributes of chemists include employee ids, names and phone numbers. The lab also wants to keep track of project ids and start dates, and equipment serial numbers and costs. The organization wishes to keep track of the date a specific piece of equipment was assigned to a specific chemist to work on a specific project. 4. Hospital A hospital has a large number of registered physicians, each with a unique physician number. Physicians all have at least one specialty. Patients are admitted to the hospital by physicians. The hospital keeps track of the patients names and addresses, and assigns each patient a unique patient identifier. Any patient who is admitted must have one and only one admitting physician. Once admitted, a patient must be treated by at least one physician. A particular physician may treat any number of patients, or may not treat any patients. Whenever a patient is treated by a physician, the hospital wishes to record the date and time of the treatment.

5. Attic Antiques Attic Antiques buys and sells one-of-a-kind antiques of all kinds (e.g. furniture, china, clothing, etc.). Each item is uniquely identified by a serial number, and is also characterized by asking price and condition. Attic works with several individuals who sell and buy items from the store. Some clients only sell items to Attic, others only buy items, and some both buy and sell. Attic keeps track of its clients through the assigning of client numbers. They also keep track of clients names and addresses. When Attic sells an item to a client, they need to keep track of the actual selling price, the date of the sale, and the sales tax. When Attic buys an item, they wish to track the purchase cost, condition at the time of purchase, and the date. 6. Robot Realty Robot Realty is a real estate firm that lists property for sale. The firm has a number of sales offices in several states. They assign each sales office an office number. Each sales office is assigned one or more employees. An employee can only be assigned to one sales office. For each sales office, there is always one employee assigned to manage that office. The employee can only manage the office to which he or she is assigned. The firm lists property for sale. They need to track the property address, and which sales office the property is listed with (it may only be listed with one sales office). A sales office may have any number of properties listed. Each unit of property has one or more owners. Robot needs to track the percent of the property owned by each owner. 7. Bank Accounts WV Bank has three different types of bank accounts available for their customers. Each customer may have any number of bank accounts, and all accounts have a unique account number. For Savings Accounts, WV Bank must keep track of the accounts balance, interest rate, and the date the account was opened. Checking Accounts pay no interest, so the bank keeps track of just the balance and date opened. The third type of account, Loans, requires tracking the date the loan was taken, the balance due, and the interest rate of the loan. Loan Accounts are also assigned to a Loan Officer, who keeps track of the account and ensures that the client is making their payments on-time. 8. Rental Car A rental car agency classifies the vehicles it rents into four categories: compact, mid-size, fullsize and sport utility. The agency wants to record the following data for all vehicles: Vehicle_ID, Make, Model, Year and Colour. There are no unique attributes for any of the four categories of vehicle. Vehicle has a relationship with a Customer entity type. None of the four classes of Vehicle has a unique relationship with an entity type.

9. Non-Profit A non-profit organization depends on a number of different types of persons for its successful operation. The organization is interested in the following attributes for all of these persons: Social Security Number, Name, Address, City, State and Telephone. Three types of persons are of interest: employees, volunteers and donors. Employees have only a Date_Hired attribute, and volunteers have only a Skill attribute. Donors have a relationship (named Donates) with an Item. A donor must have donated one or more Items, and an Item can only be donated by one donor. There are persons other than employees, volunteers and donors who are of interest to the organization, so a person does not have to belong to one of these groups. A person may also belong to one or more of these groups, at any one time.

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