Assignment 01
Assignment 01
Design an entity relationship diagrams for following scenarios and derive the relational schema
and underline all the primary keys and identify foreign keys.
Rename your softcopies as <Question Number>_<Registration Number> (Ex: 01_587)
Submission:
Submit softcopy of the diagram on or before 05th January 2021.
1. Thusitha Gems is a small company in Anuradhapura that produces two main types of
products: gems and marbles. They produce two size of gems and six sizes of marbles. Both
products are offered in 25 colours. The different kinds of decoration marbles are distinguished by
color, size and shape. Each gem is classified as a matte gem or a luster gem. The database system
keeps track of the inventory levels, the backorder level (orders not satisfied yet), and the number
of outstanding orders (orders that are not yet received). The management refers to this
information to decide when, which and how many products to produce. Other than the
information about the products, the database records information about the raw materials,
suppliers and customers. For each type of raw material, the database keeps the following
information: identification number, name, and price per unit. For each supplier, the database
records the supplier identification number, name and address. The company sells its products in
Sri Lanka and other south Asian countries. For the international customers, the company
provides special packaging and charges increased rates. For each customers, the following
information is recorded: identification number, name and address. A customer may order one or
more products, and a product may be ordered by one or more customers. Additionally, each
product is produced from one or more raw materials, and a particular raw material may be used
in multiple products. Each raw material is supplied by exactly one supplier, and a supplier may
supply one or more raw, materials.
2. Rajarata Wing is an agency which provides scholarship details for government sector. The
agency is handling both local scholarships and foreign scholarships. Each scholarship has
scholarship_id, scholarship_name, start_date and budget allocated. Local scholarships are sent
by various ministries and each scholarship is attached to only one ministry with a given duration.
Foreign scholarships are funded by one or more foreign aides with a scholarships level (Eg: Half
scholarship/ Full Scholarships) attached to it. The agency requires to keep employee details such
as employee_id, name, date of birth, address, date joined and salary. Only project officers in the
company work with local projects. Each project officer has a specialty which is recorded in order
to assign relevant tasks for them. An officer can perform several tasks related to a project. A
project officer can work on several projects and there are many project officers in one project.
Only fellowship officers can work with foreign projects. There can be many fellowship officers
attached to one foreign project but one fellowship officer can work on only one foreign project.
Each officer attached to foreign projects is given an allowance in addition to salary.
Each employee is attached to a particular division. Divisions are identified by division_id, name
and location. There is a manager in each division. Scholarship details are published in
newspapers. The data stored about newspaper includes the paper_name, address, and telephone
and contact name. When a foreign scholarship is awarded to an applicant, a bond is raised
between the applicant and the fellowship officer who handles that scholarship. The details about
applicant includes application_no, name, address, contact no and the value of the bond.
3. The company is organized into Departments. Each department has a name, number and an
employee who manages the department. We keep track of the start date of the department
manager. Each department controls number of projects. Each projects has a name, number and is
located at a single location. We store each employees’ social security number, address, salary,
sex and birthday. Each employee works for one department but many work on several projects.
We keep track of the number of hours per week that an employee currently works on each
project. We also keep track of the direct supervisor of each dependents. For each departments
keep track of their name, sex, birthday and relationship to employee.
4. U.S. House of representatives during the current two year congressional session. The database
needs to keep track of each U.S. state’s name and include the region of the state. Each congress
person in the House of Representatives is described by his or her name, plus the district
represented, the start date when the congressperson was first elected, and the political party to
which he or she belongs. The database keeps track of each bill including bill name, the date of
vote on the bill, whether the bill passed or failed, and the sponsor. The database also keep track
of how each congressperson voted on each bill.
5. Consider a mail order database in which employees take orders for parts from customers. The
data requirements are summarized as follows:
The mail order company has employees, each identified by a unique employee
number, first and last name, and Zip code.
Each customer of the company is identified by a unique customer number, first
and last name and Zip Code.
Each part sold by the company is identified by a unique part number, a part name,
price, and quantity in stock.
Each order placed by a customer is taken by an employee and is given a unique
order number. Each order contains specified quantities of one or more parts. Each
order has a date of receipt as well as an expected ship date. The actual ship date is
also recorded.
6. Consider a movie database in which data is recorded about the movie industry. The data
requirements are summarized as follows:
Each movie is identified by the title and year of release. Each movie has a length in
minutes. Each has a production company, and each is classified under one or more
genres. Each movie also has a plot outline. Finally, each movie has zero or more
quotable quotes, each of which is spoken by a particular actor appearing in the movie.
Actors are identified by name and date of birth and appear in one or more movies.
Each actor has a role in the movie.
Directors are also identified by name and date of birth and direct one or more movies.
It is possible for a director to act in a movie.
Production companies are identified by name and each has an address. A production
company produces one or more movies.