Mid_Term_Question_222_CSE3521
Mid_Term_Question_222_CSE3521
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)