Ics321 HW2 202043000
Ics321 HW2 202043000
ICS 321: Database Systems (223) Homework # 2 Due: Oct 31, 2023
1. [10 points] Consider the following relations and write the appropriate SQL statements to answer the
queries given below.
i) List the Fast name, last name, and SSN of all employees who works on a project called ‘ProductY’
or ‘ProductZ’ and have dependents
ii) List the names of all projects which have exactly three employees and have no dependents.
iii) What is the degree and cardinality of the relation produced by the cartesian product of
Name: Abdulaziz Hatem Alghamdi, ID:202043000
WORKS_ON and PROJECT.
iv) List the names of employees who work less than 5 hours per week on the ‘Computerization’ project.
v) List the names of employees who work on more than two projects.
Name: Abdulaziz Hatem Alghamdi, ID:202043000
2. [8 points] Given the following schema:
Manufacturer {Name, Street, City, State, Zip, Phone}
Product {PID, Name, Buying_Price, Selling_Price, Size, Manufacturer_Name}
Foreign Key {Manufacturer_Name} references Manufacturer,
Warehouse {Name, Location, City, State, Zip, Space}
Stores {Warehouse_Name, PID, Qty}
Foreign Key {Warehouse_Name} references Warehouse,
Foreign Key {PID} references Product;
ii. Get the PID and name of the products that are manufactured in Dammam.
iii. Get the PID and name of the products that are stored in warehouses in Jeddah.
iv. Get all pairs of warehouses and manufactures that are located in the same city. List the
warehouse-name and manufacturer-name of each pair of warehouse and manufacturer that are
located in the same city.
• Each event has a descriptive name and has a single start date and time (when the event
begins) and ending date and time.
• Each event can be classified as sports, social, religious or academic. Depending on the
classification, specific event information is stored.
• Each event takes place at a specific venue on campus. A venue is a sports area (such as an
athletic field), a lecture hall, a conference hall, or a public space. The venue information
differs depending on the type of venue.
Name: Abdulaziz Hatem Alghamdi, ID:202043000
• Each event is sponsored by an academic department. Each academic department has a person
responsible for the event.
a. Design an EER diagram for the following database. Your diagram should have all the needed
details. You may make any reasonable assumptions but you must state them clearly.
I tried with my computer but every time I tried to make ER diagram it was crashed. I hope it
is understandable.
b. Convert the EER model to a set of relations using EER to Relational mapping rules.
Name: Abdulaziz Hatem Alghamdi, ID:202043000