Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Daffodil International University

Department of Computer Science and Engineering


Faculty of Science & Information Technology
Midterm Exam Examination, Fall 2020 @ DIU Blended Learning Center
Course Code: CSE311 (Evening), Course Title: Database Management System
Level: 3 Term: 1 Section: All
Modality: Open Book Exam
Date: Sunday 8 November, 2020 Time: 07:00pm-11:00pm
Four hours (4:00) to support online open/case study based assessment Marks: 25
Directions:
• Students need to go through the CASE STUDY shown in this exam paper.
• Analyze and answer specific section based on your own thinking and work.
• Do not share as this will be treated as plagiarism by Blended Learning Center.

Q1. Consider the following scenario: 4+6

Suppose you have a huge collection of animals in your house and you want to maintain information
about the animals, the enclosures in which they live, and caretaker and the services they perform for
the animals. In addition, you arrange a program by which people can be sponsors of your animals.
You also want to track the food you feed to your animals. Each animal has a unique animal number,
species, name, gender, country of birth, and date of birth and age. Enclosures have a unique enclosure
number, type, size, and built date. An animal can live in only one enclosure. An enclosure can have
several animals in it or it can be currently empty. A caretaker has a unique employee id, name, title,
and hire date. A caretaker supervise other caretaker…..

a. Now, imagine you are a database administrator and you have to complete the above scenario
and include all the necessary information that you would like to maintain.
b. After completing your scenario, propose an Entity-Relationship diagram that captures all the
information. Be certain to indicate primary keys, relationships, participation constraints, and
cardinality constraints.

Q2. Convert the ER diagram into a relational database schema that you have already proposed in Q1.
5

Q3. Consider the following scenario: 2+2

Akib is a bookworm. He has a huge collection of books. His friends, relatives always borrow from his
collection and it is quite tough for him to keep track of all of these books. Now, he is searching a way
to maintain a document of who has what. He maintains a list of relatives and friends, identified by
SSN, name and their phone numbers so that he can contact them if needed. He also has a list of books,
identified by BID, author name and title. Whenever someone borrows a book, he will enter that fact
into record along with the borrowing date. Whenever a book is lent, that fact too, gets noted with the
date returned.

a. Akib keeps all his record in a document. Now, discuss any three problems that you think he
might face while maintaining this document?
b. If you are told to create a database for Akib, what representation model you would like to use
other than relational database model? Why you chose this model?
Q4. Consider the following schema for a database where the primary keys are given. Give an
expression in SQL for each of the queries. 6

University (Name, address, state, enrollment)


Student (sID, sName, GPA, sizeCS, admissionDate)
Apply (sID, Name, Major, decision)

Here, in the University table enrollment attribute represents numbers of students registered into that
university. In the students table sizeCS (College Size) attribute represents the numbers of students of
the College from where the student is coming.

a) Add another field in Student table, named as “Email” and give the data-type of that field as
variable character which must be size of 20.
b) Write a query to find the ID and name of those students whose name contains letter ‘A’ in the
2nd position and whose GPA is below 3.0.
c) Find the minimum, maximum and average GPA of all students.
d) Write a query to find the ID, name and GPA of top 3 students (according to GPA).
e) Find the name and GPA of students who came from a College with less than a 1000 students
and applied to major in CSE.
f) Find the major, the total number of students in each major.

You might also like