Assignment 2018-19 DBMS
Assignment 2018-19 DBMS
Write the SQL command to create Supp_Mastertable for the given data below:
There is Car Insurance company whose customers own one or more cars. Each
car is associated with zero to any number of recorded accidents. Each insurance
policy covers one or more cars and has one or more premium payments
associated with it. Each payment is for a particular period of time and has an
associated due date and the date when the payment was received.
i) Identify Entities, Attributes for each entity.
ii) Draw an ER diagram for above mentioned scenario. Also specify all
structural constraints in the diagram. State any assumptions made.
Consider a table Product:
Product_id Product_name Type Price
Consider a file with the following search values 71, 56, 59, 18, 21, 10, 74. Insert
these search values in the given order in a B+ tree of order p = 3. Show the tree
at each step.
Consider the relation R which has attributes that contain schedules of courses
and students at university.
R = {StudentID, StudentName, CourseID, CourseName,
Grade, StudentPosition}
Suppose the following FDs hold on R
CourseID,StudentID→ Grade
StudentId→StudentName
CourseId→CourseName
Grade →StudentPosition
Determine the keys of R and normalize this relation uptothird normal form.
Find the minimal cover for the given set of functional dependencies
F= {AD, BA, BCD, ACBE}of a relation R
Consider the tables given below and answer the following queries in
relationalalgebra
Employee(Fname, Lname, SSN, Sex, Salary, Super_Ssn, Dno)
Department (Dname, Dnumber, Mgr_Ssn, Mgr_start_date)
Dependent (Essn, Dependent_name, Sex, Bdate, Relationship)
(i) List the names of all employees who have a dependent with the same
first name as themselves.
(ii) Find the names of all employees who are directly supervised by
‘Franklin Wong’.
(iii) For each department , retrieve department number, the number of
employees in the department and their average salary.
Student
Find the output of the following expressions in relational algebra on the tables
I. T1/T2
II. T1UT3
III.
IV. T1∩T2
T1 T2 T3
A B
X Y
X d a
a b
a e d
c d
c b
c
c b
b a
d a
For the given binary relationship, suggest the cardinality ratio of the relationship based
on the usual context of entity types and state the context clearly:
4
Entity1 Entity2
Faculty Course
Student Course
Course Book
How data independence is achieved using the three tier architecture of a database
management system?
Give an example of each of Total-disjoint specialization and partial-disjoint
specialization in the context of EER modelling.
T1 _____ T2 _________
read_item(B)
B = B+1
read_item(B)
read_item(A)
A = A+B
write_Item(B)
read_item(A)
write_Item(A)
write_Item(A)
On the completion of the transactions T1 and T2 what will be the value of A and B. Justify your
answer.
Find the minimal cover for the given set of functional dependencies {BC->D,
AC->BE, B->E}
of a relation R
Consider the Relation R (ABCDEFGH)and the following set f of Fds of R: F = {CH -> G, A ->
BC, B -> CFH, E -> A, F -> EG}
i. What is the key of the relation R?
ii) Apply normalization to convert it into 3NF stating the reasons behind each decomposition
Why can we have at most one primary or clustering index on a file, but several secondary indexes?
Consider a file with the following key values: 17, 7, 11, 8, 41, 4, 13. Suppose these search key values are
inserted in the given order in a B+ tree of order p = 3. Show the tree at each step.
Salesman
(salesman_id, name, city, commission)
Orders
(ord_no, amt, ord_date, customer_id, salesman_id)
Customer
(customer_id, cust_name, city, grade, salesman_id)
i. Display number of copies of book titled”Data Base Management System” owned by library branch
the name of which is “Delhi Public Library”.
ii. Display number of copies of book titled “Data Base Management System” owned by each library
branch.
iii. For each book authored by ‘Navathe’, retrieve the title and the number of copies owned by the
library branch whose name is ‘Central’ .
State referential integrity constraint and depict the referential integrity constraints for the above relational
schema diagrammatically.
Map the following ER diagram to a set of relational tables.