3-Winter 2022-23 PDBMS-Questions

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 5

Vellore Institute of Technology, Vellore

School of Computer Science and Engineering (SCOPE)

Digital Assignment I

CSE2031- Principles of Database Management Systems (A2 Slot)

Winter Semester - 2022-23

Faculty: Dr.V.Ilayaraja Date: 26.03.23

Name: KRUTHIKA.J

Slot: A2+TA2

Registration number: 20BCT0353

1. Consider the following table (Price Update List), This report is used by the
department managers to update the prices that are displayed in the grocery store for
these products.

Note: 1. examing the relationship between department and product, we discover


that it is a 1:M, therefore we do not need the composite table, dept_product. So it is
eliminated and the foreign key placed in the product table.

2. it may be debatable whether department actually determines aisle number. This


may be true in a small grocery store but in a large grocery store, products from a
department may be found in multiple aisles. This should be discussed with your database
client to determine their exact needs.

Form an unnormalized normal form, convert it to 1NF, 2NF and 3NF.


Department Product Aisle Price Unit of
Code Number Measure

Produce 4081 1 0.35 lb


Produce 4027 1 0.90 ea
Produce 4108 1 1.99 lb

Butcher 331100 5 1.50 lb


Butcher 331105 5 2.40 lb
Butcher 332110 5 5.00 lb

Freezer 411100 6 1.00 ea


Freezer 521101 6 1.00 ea
Freezer 866503 6 5.00 ea
Freezer 866504 6 5.00 ea

2. Consider the following relation for published books:

BOOK(BookTitle, AuthorName, BookType, ListPrice, AuthorAffiliation, Publisher)

Suppose the following dependencies exist:

What normal form is the relation in? explain your answer. Apply normalization
until you cannot decompose the relations further. State the reasons behind each
decomposition.

 Given the relation:➢Book(Book_title, Authorname, Book_type,


Listprice,Author_affil,Publisher)

FD:
➢Book_title -> Publisher, Book_type

➢Book_type -> Listprice➢Authorname-> Author_affil

•The key for this relation is:

➢Book_title,Authorname

•This relation is in 1NF and not in 2NF as no attributes are FFD on the key. It is also not in 3NF

DB Normalization

•Given the relation:

➢Book(Book_title, Authorname, Book_type, Listprice,Author_affil, Publisher)

FD:

➢Book_title -> Publisher, Book_type

➢Book_type -> Listprice➢Authorname-> Author_affil

•2NF decomposition:

➢Book0(Book_title, Authorname)

➢Book1(Book_title, Publisher, Book_type, Listprice)

➢Book2(Authorname, Authoraffil)

DB Normalization

•Given the relation:

➢Book(Book_title, Authorname, Book_type, Listprice,Author_affil, Publisher)

FD:

➢Book_title -> Publisher, Book_type


➢Book_type -> Listprice

➢Authorname-> Author_affil

•3NF decomposition:

➢Book0(Book_title, Authorname)

➢Book1-1(Book_title, Publisher, Book_type)

➢Book1-2(Book_type, Listprice)

➢Book2(Authorname, Author_affil)

This decomposition eliminates the transitive dependency of Listprice

3.

lets take:

m : number of values

p : number of pointers

Rules for splitting in B+ tree:


 If the node is leaf node then to split the node we take ceil((p)/2). Then ceil((p)/2) values
will go in the left child node and remaining values will go in the right child node after
splitting. And the minimum value from the right child node is put in the parent node.
 If the node is the root node then we split from ceil((p)/2) + 1th value of the node and put
it as the parent.

Now we will solve the above example:

key values : (2,3,5,7,11,17,19,23,29,31)

a.) Number of pointers are 4:

Since the number of pointers, p = 4, it means number of values i.e., m = 3.

4. After construction of each B+ tree of question 3 (a, b and c), show the form of the tree
after each of the following series of operations also: (Note: Show the updated tree for
each B+ tree (question 3.a, 3.b and 3.c)
i. Insert 9
ii. Insert 10
iii. Insert 8
iv. Delete 23
v. Delete 19

You might also like