DBS 2020-Arid-0125
DBS 2020-Arid-0125
To be filled by Student
Notes:
1. By filling out your name and registration number above, you Pledge that: “I affirm
that I have not given or received any unauthorized help on this exam/assignment,
and that this work is my own.”
2. Any student found breaching the “Regulations Relating to the Examinations of
PMAS-Arid Agriculture University, Rawalpindi”, will face severe penalties.
3. Any form of Cheating, Unauthorized Help, and/or Plagiarism found in the Answers
given below will have severe penalty for the student, ranging from cancellation of
paper to suspension from the University rolls for up to 2 years.
Q.No.1 Analyze the given entity relationship diagram and answer the following questions.
[12 Marks]
a) What is the degree of “has” relationship?
b) Identify primary key(s)
c) Identify the category of each attribute
d) Name the cardinalities
Answer:
Q.No.2 Contrast among the following; [10 Marks]
a) Generalization; Specialization
b) Entity type ;Entity Instance
c) Primary key; Composite key
d) Relation; Relationship
Answer:
Q.No.3 Create an Entity-Relationship Model to represent the data requirements of the
problem given below. Specify the cardinalities of relationships and all-important
constraints. Also mention the assumptions if you have made any. [20 Marks]
A person can be an employee, alumnus or a student. For person P_id (identifier), date of
birth, gender and contacts are stored. Person can have more than one contact numbers and
there are no other types of person that exists. An instance of person can belong to more
than one type. Date hired and salary is the unique attributes of employee. For alumnus
degree is required to be stored that comprises of year and designation. Major department is
the attribute of student. A student can be a graduate student or an undergraduate student
but not both at the same time. No other type of student exists. For graduate student test
score is stored and for undergraduate student class standing is stored. Employee can be
faculty, staff or others but not both at the same time. For faculty rank is stored and for staff
position is stored. Undergraduate student can issue books from the library. An
undergraduate student can issue at most one book and a book is issued by no student or
one student. Issue date, return date and fine amount are stored when undergraduate
student issues a book. Book has attributes b_id, b_title and b_category and b_id is the
primary key for the book. Undergraduate student can get enrolled for more than one
courses and a course is enrolled by at least one undergraduate student. Course has
attributes course_id (identifier), credit, description and code. Courses can have one, none, or
many prerequisites. Each course is prerequisite of zero, one or many courses. Department offers
one or more courses and a course gets offered by one or many departments. Every instance
of department has unique dept_id and other attributes are name and location that needs to
be stored. Location is composed of city, postal code and zip code.
Answer:
Q.No.4 [30 Marks]
Patient Doctor
b) Assume the schema given above and identify the following queries are executable
or not. If yes then draw their results, if not then mention their errors.
1) Select * from patient where age between not 25 and 31;
2) Select D_Fname+’ ‘+D_Lname as [name] from doctor where D_Fname like
‘_[^ubs]%’ ;
3) Select P_Name, gender from patient where age in(25,29,38) or gender=’Mle’ ;
Answer: