ilovepdf_merged (1)
ilovepdf_merged (1)
Any examinee found adopting unfair means will be expelled from the trimester / program as
per UIU disciplinary rules.
_________________________________________________________________________________
1. a) “Urao” is a leading airline in Bangladesh, which has decided to automate its entire 8+
flight management system to enhance service quality and customer satisfaction. To 2=
design the system the following requirement specifications were provided to a 10
software development company:
The airline operates from several airports throughout Bangladesh and internationally.
Each airport has a unique airport code, airport name, city, country, and contact phone
number. The airline operates multiple flights daily. Information stored about each
flight includes the flight number, airline name, departure time, arrival time, flight
status (Scheduled, On-Time, Delayed, or Canceled), and the airports from which the
flight departs and arrives. Each flight has a unique flight number across the airline's
network.
Each flight is assigned a specific aircraft. The details stored for each aircraft include a
unique aircraft ID, model name, manufacturer, number of economy seats and the
number of business class seats. An aircraft can be assigned to multiple flights over
time, but only one flight at a time.
Passengers must register with the airline before booking a flight. Information stored
about passengers includes their first and last names, address, contact number, and
email. Each registered passenger is assigned a unique passenger ID.
Flight bookings are mandatory for passengers intending to travel. A booking includes
the booking ID, booking date, payment status (Paid or Unpaid), total fare, passenger
ID, and the flight number for which the booking is made. Each booking is assigned a
unique booking ID.
Additionally, each flight is staffed by a team of crew members, including the pilot, co-
pilot, and cabin crew. The information stored about crew members includes a unique
crew ID, name, role (Pilot, Co-Pilot, Cabin Crew), years of experience, salary, and the
flight number they are assigned to. A flight may have multiple crew members assigned
to it.
Finally, for each flight, multiple tickets are issued. Ticket information includes a
unique ticket ID, seat number, travel class (Economy or Business), booking ID, and
the passenger ID for the person using the ticket. A booking may include multiple
tickets if several passengers are traveling together.
Now, design an ER diagram for the Scenario capturing all the entities, their
cardinalities and relationships.
b) “All super keys are eligible to be primary keys” - support or refute this statement
with proper reasoning and examples.
2. Draw the corresponding schema diagram based on the erd given in Figure 1. 5
a) Write an SQL query to create the Showroom table. location and opening_date
columns must not allow null values.
b) Add a new column „showroom_id‟ to the employee table, which should store
the showroom each employee is assigned to and ensure that it references the
Showroom table. [Consider this change for the following questions]
c) Find the name, description, and stock quantity of products that have a price
greater than 1000 taka.
d) Find the employee names who earn more than their manager.
e) Find the product ID, name and the number of times each product has been
ordered and display the results in descending order.
f) Find all the showrooms that have the top three most number of employees.
Midterm Exam, Trimester: Spring 2024
Course Code: CSE-3521 Course Title: Database Management Systems
Total Marks: 30 Duration: 1 hour 30 minutes
Any examinee found adopting unfair means will be expelled from the trimester / program
as per UIU disciplinary rules.
1. An event organizer Company named “Elite” is currently try to convert their analog file- 7
system to a digital database. They want it to be able to handle the current processes.
For every event, they store the name of the event, start date, end date, venue, description
in their books. They also store detailed information about the venue like address,
capacity etc. They also assign one of their employee as the supervisor for the event. The
supervisor’s contact info and previous arranged events are needed to be accessed the
current customers.
Elite also keeps information about their employees. For each event they also keep track
of the expenses. They stores the services expenses and expense for buys item/materials
separated books. They want to keep this same when converting to data base system.
They also keep track of the guest list and people who attended the event. Elite want a
database that can handle the above functionalities
Page 1 of 4
Diagram 1
Page 2 of 4
Customers Table: [CustomerID (Primary Key), FirstName, LastName, Email, Phone]
Orders Table: [OrderID (Primary Key), CustomerID (Foreign Key, referencing Customers
Table), Date, TotalAmount]
OrderDetails Table: [OrderDetailID (Primary Key), OrderID (Foreign Key, referencing Orders
Table), BookID (Foreign Key, referencing Books Table), Quantity, Subtotal]
i. Create tables/entities mentioned above (with the primary key & foreign keys).
ii. Add an attribute 'website' to the Publishers table.
iii. Remove 'id' from the Publishers table and make 'name' the primary key. Show the necessary
steps needed to be taken sequentially with corresponding SQL queries.
i) Find all the information of trips between 1000 to 5000 tk on 29th February.
Page 3 of 4
ii) Find the names and vehicle id of drivers who had vehicles whose status are “Unfit”.
iii) Find the output for the following:
Note: Date format is YYYY-MM-DD. And for the last question, write a sentence describing
what
the query will return.
Page 4 of 4
Midterm Exam, Trimester: Spring 2024
Course Code: CSE-3521 Course Title: Database Management Systems
Total Marks: 30 Duration: 1 hour 30 minutes
Any examinee found adopting unfair means will be expelled from the trimester / program
as per UIU disciplinary rules.
1. An event organizer Company named “Elite” is currently try to convert their analog file- 7
system to a digital database. They want it to be able to handle the current processes.
For every event, they store the name of the event, start date, end date, venue, description
in their books. They also store detailed information about the venue like address,
capacity etc. They also assign one of their employee as the supervisor for the event. The
supervisor’s contact info and previous arranged events are needed to be accessed the
current customers.
Elite also keeps information about their employees. For each event they also keep track
of the expenses. They stores the services expenses and expense for buys item/materials
separated books. They want to keep this same when converting to data base system.
They also keep track of the guest list and people who attended the event. Elite want a
database that can handle the above functionalities
Page 1 of 4
Diagram 1
Page 2 of 4
Customers Table: [CustomerID (Primary Key), FirstName, LastName, Email, Phone]
Orders Table: [OrderID (Primary Key), CustomerID (Foreign Key, referencing Customers
Table), Date, TotalAmount]
OrderDetails Table: [OrderDetailID (Primary Key), OrderID (Foreign Key, referencing Orders
Table), BookID (Foreign Key, referencing Books Table), Quantity, Subtotal]
i. Create tables/entities mentioned above (with the primary key & foreign keys).
ii. Add an attribute 'website' to the Publishers table.
iii. Remove 'id' from the Publishers table and make 'name' the primary key. Show the necessary
steps needed to be taken sequentially with corresponding SQL queries.
i) Find all the information of trips between 1000 to 5000 tk on 29th February.
Page 3 of 4
ii) Find the names and vehicle id of drivers who had vehicles whose status are “Unfit”.
iii) Find the output for the following:
Note: Date format is YYYY-MM-DD. And for the last question, write a sentence describing
what
the query will return.
Page 4 of 4
Midterm Exam, Trimester: Fall 2023
Course Code: CSE-3521 Course Title: Database Management Systems Total
Marks: 30 Duration: 1 hour 45 minutes
Any examinee found adopting unfair means will be expelled from the trimester / program
as per UIU disciplinary rules.
1. a) Suppose you want to design a software system to manage Gym Membership of 7
UIU. You tried to talk with the gym supervisor to find out the detailed information about
gym management. The requirements are given below,
The gym has a registration process for the students, faculties and staff of UIU. Users
should be able to register for an account with their personal information, including name,
ID, contact information, and a unique username and password. Registered users should
be able to log in securely with their credentials. Gym trainers and administrators, should
have additional privileges and access rights.
The system should provide information about different membership plans, including their
features, pricing, and duration (e.g., monthly, annual). No membership plan with the same
type (regular or economic), price and duration are allowed to be set. However the same
plan may have multiple working features in it. Prospective members should be able to
view and compare the available plans before making a decision.
Prospective gym members should be able to enroll in a specific membership plan. The
system should handle the payment process for membership fees, with options for payment
methods (e.g., credit card, cash).
Members should be able to schedule fitness training sessions, one-on-one consultations
with trainers. Staff members should be able to manage and confirm these appointments.
The system should track member attendance, allowing staff to record check-ins and
check-outs. The check in day and time should be unique for a specific member as no
member is allowed to enter twice in the same day. Attendance records can help in
assessing member engagement and plan utilization.
b) Explain the parts of the query processor in database system structure. “An
identifying relationship between two entities is known as a strong relationship”, do you
agree with this statement? If yes, justify your answer with proper explanation.
Page 1 of 3
2 a) Write the corresponding schema of the following ER diagram. 5
Page 2 of 3
iv. By using subquery, find the date, venue, and result of matches in which players from
"Team Australia" took more than 5 wickets. For each match, list the player's name who
achieved this and the number of wickets they took.
2+2+2
Page 3 of 3
Midterm Exam, Trimester: Summer 2023
Course Code: CSE-3521 Course Title: Database Management Systems
Total Marks: 30 Duration: 1 hour 45 minutes
Any examinee found adopting unfair means will be expelled from the trimester / program
as per UIU disciplinary rules.
1. a) A well-known car rental company in Bangladesh named "SHEBA- Rent A Car" has 7
made the decision to automate the entirety of their manual system in order to better
serve their clients. The data specifications they gave to a software company are as
follows:
The Car Rental Company has several branches throughout Bangladesh. The information
stored for each branch includes the branch's phone number, address, which consists of
the road number, area, city, and zip code. Each branch is assigned a branch number,
which is distinctive across the entire organization. There are several employees assigned
to each branch, including a manager. The manager is in charge of overseeing the
day-to-day operations of a specific branch. The information kept on a staff person
includes their name, title, date of hire, pay, and experience. Within the organization,
every employee has a distinct staff ID. Many rental cars are available at each branch.
The brand name, model number, license plate number, category, daily rental cost, status,
and the driver's name are among the information stored about a car. In a branch, there
may be several cars of the same model. Cars are divided into categories as Private,
Noah, Ambulance, Mini bus, etc. The status shows whether or not a car is available for
rental. A customer must register with the company before renting a car. The first and last
names, address, registration date, and branch name are the data that is stored on a
customer. A unique customer id is provided to each customer. Customers who register
can rent cars. The data stored on each rented car includes the rental number, the renter's
name and phone number, the license plate number, and the date and time of the rental.
The rental number is unique within the company.
b) Explain what you understand by the redundancy control property of the database 2
management system for multiple use. Differentiate between candidate key and primary
key.
Page 1 of 2
2 a) Write the corresponding schema of the following ER diagram 5
b) Mention different kinds of mapping cardinalities and how they can be handled in 3
schema? Explain Identifying Relationship Set and Non-Identifying Relationship Set.
Page 2 of 2
v. Find out the Employee name and assignment id of the 2nd first employee based
on the number of assignments provided for that employee.
Page 3 of 2
Midterm Exam, Trimester: Spring 2023
Course Code: CSE-3521 Course Title: Database Management Systems
Total Marks: 30 Duration: 1 hour 45 minutes
Any examinee found adopting unfair means will be expelled from the trimester / program
as per UIU disciplinary rules.
1. a) UIU CSE Alumni Association is planning to launch a web portal for job seekers of 7
UIU and recruiters all over the globe. The job portal manages each job seeker’s profile
where each person is represented by their user id, name, unique email, address, date of
birth, educational qualifications, and job experiences. Educational qualification will
contain degree name, institution name, achieved year, and grade. Job experience will
have job title, institution name, job type, starting date, and duration.
Job seeker’s can be hired by individual recruiters or by the companies. The recruiters
also have their own profiles which will have recruiter id, name, email, and reputation
score.
The recruiters and companies can post job openings to the job portal. The job portal
keeps track of each post’s date, time, contents, and number of viewers. The system also
keeps track of which job seeker is interested in which job posts. One recruiter/company
can recruit more than one job seekers for a job.
Each of the companies are maintained by their unique id, name, address and contact
no. Each user can provide his or her anonymous review of companies. Each of the
reviews contains review id, date, time, review details.
Design an ER Diagram for the scenario that satisfies all the given requirements.
b) Write the corresponding schema of the following ER diagram 4
1
c) Answer the following questions 4
i. What is mapping cardinality?
ii. What are the possible mapping cardinalities for a binary relationship set?
iii. What are the problems with many-to-many relationships?
iv. How do you resolve a many-to-many relationship in the database?
2. a) Consider the following schema 6
Player (id, name, position, ranking, team_id, age)
Team (id, name, ranking, trophy_count)
Coach (id, name, nationality, year_of_experience, trophy_count, ranking, t_id)
Match (id, home_team, away_team, h_score, a_score, day, month, year, result, POTM)
Match_details (p_id, m_id, rating, goal, assist, key_pass, tackle_won, saves)
2
Mid Term Exam, Trimester: Summer 2022
Course Code: CSE-3521, Course Title: Database Management Systems
Total Marks: 30, Duration: 1 hour 45 minutes
Any examinee found adopting unfair means will be expelled from the trimester /
program as per UIU disciplinary rules.
The Art Gallery stores all the artist information including unique artist_id, name, age, and
address. An artist can have multiple addresses containing holding no., street name, and
city. An artist can have many arts.
Art is described by unique art_id, title. Every art has art details. This detail contains
category, style, subject, medium, material, and tag. This system also stores the date when
the art was created.
Curators take care of the arts and place them in the right places(rooms). Art can be taken
care of by many curators and a curator can take care of many arts. Curators assign a
virtual room for each art. A room has a unique room_id, title, and size. The system also
stores the date when a curator places art in a room. Curators have unique curator_id,
name, and hiring date.
Art lovers can see the arts and they have a unique id, name, and address.
2. a) Give a brief explanation about data abstraction in the case of database management 4+7
systems. Can all candidate keys be a primary key? Justify your answer with proper
explanation.
b) Write the corresponding schema of the ER diagram given below.
3. 8+3
Figure 1: HR Schema
a) Use the given HR schema (Figure 1) to write the following queries (I-V)
I. Show the employee id, email and full name of those employees whose employee id
ranges between 110 and 200. Full name format: first_name<space>last_name
II. Write a query to display the top 5 jobs details considering Max_Salary. (Hint:
Higher Max_Salary means better job).
III. Write a query to get the department id-wise difference between the average
salary and minimum salary of the employees. Only consider the departments
having minimum salary of less than 4000.
IV. Write a query to display the city and number of departments in each of the cities
by the descending order of the cities.
V. Write a query to find the name (first_name, last_name), and salary of the
employees who earn more than the average salary and have the string ‘er’ starting
at the 3rd position of their first name. (use subquery)
Any examinee found adopting unfair means will be expelled from the trimester / program
as per UIU disciplinary rules.
1. a) Compare and contrast different types of attributes used in Entity Relationship Diagram. 3+7
b) You have been asked to design an Employee Tracking Database for CITS UIU. CITS wants
to track information about employees, the employees job history, and their certifications.
Employee information includes employee id, first name, last name, NID, address, city, state,
zip, home phone and email address. An employee will have two addresses, current and
permanent. Job history would include job title, job description, pay grade, salary, joining
date, and total service year. For certifications, they want certification name, type,
complexity level, and date achieved. An employee can have multiple designation at the
same time, (i.e., Professor, Director).
Now draw an ER diagram for this application. Be sure to mark the multiplicity of each
relationship of the diagram. Decide key attributes and identify them on the diagram. Please
state clearly if you make any assumption in your answer.
2. a) “All candidate keys are super keys, but not all super keys are candidate keys” – justify this 3+7
statement with example.
b) Write the corresponding schema of the ER diagram shown in Fig. 1 on the next page.
3. a) Consider the schema in Fig. 2 for writing the SQL mentioned in i to vi: 6+4
i. Write the DDL commands for the existing tables of the given schema:
● Add a new column in the ‘Project’ table named ‘Project_details’ with varchar
(500) data type. Then, change the data type of ‘Project_details’ to varchar
(1000).
● In the ‘Department’ table add two new constraints to the column
Dept_name so that it should be unique and not null.
ii. Show the Dept_Id wise total no of employees and average salary from the
‘Employee’ table. Only consider those departments that have the total no of
employees greater than 5.
iii. From the ‘Department’ table, show Dept_name and Location group name.
Group the location based on the following criteria:
Location Location_group
Page 1 of 3
iv. From the ‘Project’ table, show the project details of the projects that have
the pattern “IT” in Project_name with minimum 6 characters in the name. Consider
the projects whose Project_Id is an even number.
Show employee full name, salary, and project name by the descending order of
salary from ‘Employee’ and ‘Project’ table for all the employees (even if they have
not been assigned in any project).
Show the first_name, salary, Dept_Id of the employees from the ‘Employee’ table.
Include the employees with the maximum salary of 50000 and the minimum
salary of 15000.
Shop_details
84620 A Uttora
45632 B Gulshan
86145 C Dhanmondi
Inventory
1 Burger 10 8 45632
2 Pizza 5 15 84620
3 sandwich 6 10 45632
Page 2 of 3
Fig. 1: ER Diagram for Question 2(b)
Page 3 of 3
Answer ALL of the following questions:
1. Draw the corresponding Relational Schema for the following ER-Diagram. [CO1] 4
Students get a unique student id and their name, date of birth and age is also stored. The name
consists of the first name and the last name of a student. A student pays his/her fees and the fee
date is stored. Students can select one student to be their batch leader.
Courses have their unique course name and the credit hours, number of sections and the type of
the course are stored. Students can enroll in several courses and the trimester name is stored for
each enrollment.
For each fee, it gets a fee number and the amount gets stored. The fee number can not uniquely
identify each fee but can be uniquely identified for each student. [CO1]
3. 8
Table name Column names
professor(profname, deptname)
department(deptname, building)
committee(profname,commname)
a. Find all the professors who are in any one of the committees that Professor Smith is in.
b. Find all the professors who are in at least all those committees that Professor Smith is
in.
c. Find all the professors who are in exactly (i.e., no more and no less) all those
committees that Professor Smith is in.
United International University
Department of Computer Science and Engineering
CSE 3521 – Database Management Systems, Mid Term Exam, Summer 2021
Total Marks: 20, Time: 1 hour
a) Show all those test match details that were played by the team named ‘teamUIU’ and played between the year
2015 to 2021 inclusive.
b) For each player of allrounder role, show his name and calculate the total number of wickets he has taken.
“Any examinee found adopting unfair means will be expelled from the trimester / program as per UIU disciplinary rules.”
c) For each player, count the total number of his senior teammates of the same role. Do not consider players having
less than 3 senior teammates.
d) Show the player(s) details who was dismissed the maximum number of times by ‘LBW’. If multiple players have the
same maximum number of LBW records then show all of their information.
or,
Show the player(s) details who has scored maximum average runs. If multiple players have the same maximum
average runs then show all of their information.
a)
SELECT o_date, amount, user_id, payment_id
FROM orders
WHERE payment_id IS NOT NULL
ORDER BY o_date DESC, amount DESC
b)
SELECT u.name,
order_count.num_orders
FROM users AS u
JOIN
(
SELECT user_id AS u_id, COUNT(*) AS num_orders
FROM orders
GROUP BY user_id
) AS order_count
ON u.id=order_count.u_id
c)
SELECT u.name
FROM users AS u
WHERE 1 < (
SELECT COUNT(*)
FROM orders AS o
WHERE o.user_id = u.id
)
“Any examinee found adopting unfair means will be expelled from the trimester / program as per UIU disciplinary rules.”
United International University
Department of Computer Science and Engineering
CSI 221 Database Management Systems Mid Examination: Fall 2020
Total Marks: 20 Time: 1 hour
Answer all the questions. Numbers to the right of the questions denote their marks.
1. (a) Show the output for the following MySQL query from the emp table: [4]
emp
p q r s
10 4 10 b
SELECT p%q, SUM(r), COUNT(s) 5 2 20 e
FROM emp 16 8 10 a
WHERE s NOT IN(‘a’,‘d’) GROUP BY 27 4 10 f
p%q HAVING COUNT(s)<2; 2 5 30 b
43 10 30 d
61 4 40 f
80 20 20 e
(b) Write necessary MySQL statements for the following query problem based on the given schema: [4]
Student (sid, fname, lname, cgpa, dob, dept)
Show the student id, full name, age for only those students whose department is either “EEE”/“CSE” and
whose birth year is greater than or equal to January 2002 and lname starts and ends with a vowel. Show the
output in ascending order of student’s lname and descending order of their age. [For convenience, you can use
YEAR, DATEDIFF, CONCAT functions]
A B C D C D E B E
S-101 Sazzad Hossain 3000 Hossain 3000 101 Sazzad 101
S-102 Ayan Mahmud 5000 Hassan 3300 103 Ayan 105
S-103 Sadman Zarif 4000 Zarif 4000 102 Sadman 102
S-104 Sanzida Zahan 2500 Ahmed 2800 104 Nahar 109
Simulate all the following Relational Algebraic Expression. You have to show each and every steps of the simulations.
(a) σ E>102 ((x ./ y)∪(x ./ z))
(b) Show that, x ./ y = x ./ y ∪ x ./ y
3. Based on the following relations s1 and s2, answer the multiple choice questions: [2.5+2.5]
s1
s2
F G H
G K
1 a α
a 100
2 b β
b 200
3 c γ
e 400
4 d β
(a) How many rows will be returned based on this relational algebraic expression: ((s1 ./ s2)∩(s1 ./ s2))
i) 4 ii) 2 iii) 6 iv) 5
(b) Which one of the following is a part of the output of this expression: ((s1 ./ s2)-(s1 ./ s2))
i) (1, a, α, 100) ii) (3, c, γ, 400) iii) (null, e, null, 400) iv) (2, b, β, 200)
United International University
Department of Computer Science and Engineering
CSI 221 - Database Management Systems, Mid Exam, Summer-2020
Total Marks: 20, Time: 1 hour
employees departments
id(PK) name join_date dept_id(FK) man_id(FK) dept_id(PK) name
1 Stanly 2020-06-10 1 2 1 IT
2 Anderson 2020-06-01 2 4 2 Admin
3 Alexandar 2020-06-05 1 6
4 Bill 2020-06-20 2 4
5 Elon 2020-06-18 1 5
6 Zakarburg 2020-06-22 1 5
Here,
- The dept_id column of employees table refers to the dept_id column of departments table.
- The man_id column of employees table refers to the id column of employees table. (man_id = manager id)
Now show the output for each of the following MySQL queries: [1.5*4=6]
i. SELECT id, name, join_date FROM employees WHERE id != man_id ORDER BY join_date DESC LIMIT 0,3;
ii. SELECT e1.name, e2.name FROM employees AS e1 JOIN employees AS e2 ON e1.man_id = e2.id and
e1.join_date > e2.join_date;
iii. SELECT d.dept_id, d.name, COUNT(e.id) AS ‘no of employees’ FROM employees AS e JOIN departments AS d ON
e.dept_id = d.dept_id WHERE e.name LIKE ‘%a%’ GROUP BY d.dept_id, d.name HAVING COUNT(e.id) > 1;
iv. SELECT e1.id, e1.name, e1.dept_id FROM employees AS e1 WHERE e1.join_date = (SELECT MIN(e2.join_date)
FROM employees AS e2 WHERE e2.dept_id = e1.dept_id);
“Any examinee found adopting unfair means will be expelled from the trimester / program as per UIU disciplinary rules.”
3. Consider the following Database Schema:
a. Write necessary MySQL statements for any 1 of the following query problems: [2]
i. Show the title, album and category of those songs having duration more than 5 minutes, released during the
year 2019 and the category is either ‘Jazz’ or, ‘Rock’ or, ‘Classic’.
ii. Show the top rated 5 song details of singer ‘Topu’.
b. Write necessary MySQL statements for any 1 of the following query problems: [2.5]
i. Show the total no of songs released and their average time duration for each year and each category. Don’t
consider songs from album ‘Folklore’ and also avoid those groups having less than 5 songs.
ii. For each user, show the user name and count the total no of songs that have been added to his playlist
during the year 2020.
c. Write necessary MySQL statements for any 1 of the following query problems: [2.5]
(You can’t use LIMIT statement)
i. Show those songs title and singer name that have the highest rating in its own category.
ii. Show the maximum total number of users from all user ranks.
d. Write necessary MySQL statements for any 1 of the following query problems: [3]
(You can’t use LIMIT statement)
i. Show that song details that is added by maximum number of users in their playlist.
ii. For each rank, show the user name and email who has added maximum number of songs in his playlist.
“Any examinee found adopting unfair means will be expelled from the trimester / program as per UIU disciplinary rules.”
United International University
Department of Computer Science and Engineering
CSI 221 Database Management Systems Mid : Spring 2020
Total Marks: 30 Time: 1 hour 45 minutes
Answer all the questions. Numbers to the right of the questions denote their marks.
1. (a) Consider a university database for the scheduling of classrooms for nal exams. This database could be
modeled as the single entity set exam, with attributes course-name, section-number, room-number, and time.
Alternatively, one or more additional entity sets could be dened, along with relationship sets to replace some
of the attributes of the exam entity set, as
• course with attributes name, department, and c-number
• section with attributes s-number and enrollment, and dependent as a weak entity set on course
• room with attributes r-number, capacity, and building
i. Show an E-R diagram illustrating the use of all three additional entity sets listed. [5]
ii. Explain what application characteristics would inuence a decision to include or not to include each of
the additional entity sets. [2]
(b) Draw a specialization/generalization hierarchy of the following entity to store information in a database. [3]
• A police force help people to stop crimes
I would expect at least TEN entity types. You could consider various entities including dierent types of crime,
dierent types of people, and dierent types of weapon. Make sure that the hierarchy is at least three levels
of entity types deep. Don't show attributes or include relationships other than the sub/supertype entities.
2. Show the results of each query for the given tables: [3+3]
player club
p_id salary club_id rank club_id country_name coach_id budget
(a) 2 20000 5 1 1 Bangladesh 2 30000
3 6000 3 3 5 Brazil 3 20000
1 15000 6 2 10 France 6 20000
5 9000 5 3 6 Brazil 10 50000
Note that the Employees relation describes pilots and other kinds of employees as well; every pilot is certied
for some aircraft, and only pilots are certied to y.
i. Find the names of pilots whose salary is less than the price of the cheapest route from Los Angeles to
Honolulu
ii. For all aircraft with cruisingrange over 1000 miles, nd the name of the aircraft and the average salary
of all pilots certied for this aircraft.
iii. Print the enames of pilots who can operate planes with cruisingrange greater than 3000 miles but are not
certied on any Boeing aircraft.
rel-a rel-b rel-b
P Q R S R S T R S T
3. 100 Akbar Ali 20000 Ali 20000 101 Ali 20000 101
103 Tom Cruise 10000 Hanks 42000 103 Hanks 42000 103
104 Tamim Iqbal 50000 Reves 40000 105 Reves 40000 105
102 Tom Hanks 40000 Cruise 10000 101 Cruise 10000 101