Department of Advanced Science and Technology University of Computer Studies (Thaton) Semester (III) (B.C.Sc. / B.C.Tech.) Examination Database Management System (CST-2124) September, 2023 Answer all questions. Time allowed: 3 hours I. II. Choose the correct answer for each of the following statements. 1. (c) 11. (b) 2. (b) 12. (b) 3. (a) 13. (c) 4. (d) 14. (c) 5. (b) 15. (c) 6. (c) 16. (d) 7. (d) 17. (c) 8. (c) 18. (a) 9. (b) 19. (b) 10. (d) 20. (c) π π 1. οfid, flight_date, time, src, destination (π mark) (ο³ src = “Chennai” (π mark) ^ destination = “New Delhi” π π (πmark) (flight)) (π mark) π π 2. οfid, flight_date, time, src, destination(π mark) (ο³ flight_date = “01/11/2023” (π mark) π “01/11/2023” ( π ^ flight_date = π mark) (flight)) (π mark) π 3. οfid(π mark) (ο³pid=123 ^ destination = “Chennai” π (π mark) π ^ flight_date < “06/10/2023” π (π mark) π (flightβfid=fid booking) (π mark) βpid=pid passenger) (π mark) π 4. οpname (passenger) ( mark) - (οpname (passengerβpid=pid booking)) (π mark) π π π π π π π 5. οagency_name( mark) (ο³agency_city=pass_city ^ pid= 123 ( mark) (agencyβaid=aid booking) ( π mark) βpid=pid passenger) (π mark) III. π (a) create table customer ( π¦ππ«π€) π π (cid varchar (5), cname varchar (30), address varchar (20), (π π¦ππ«π€) primary key (cid)); (1 mark) π create table meter_box (π π¦ππ«π€) π (mbid varchar (5), type varchar (10), keeps_tip int, (π π¦ππ«π€) primary key (mbid)); (1 mark) π create table unit_price (π π¦ππ«π€) π (upid varchar (5), mbid varchar (5), ranges varchar (25), price int, (π π¦ππ«π€) primary key (upid), (π π¦ππ«π€) π foreign key (mbid) references meter_box (mbid) (π π¦ππ«π€) π on delete cascade on update cascade); (π π¦ππ«π€) π create table receipt (π π¦ππ«π€) (rid varchar (5), cid varchar (5), upid varchar (5), useunit int, dueDate int, π amount int, primary key (rid), (π π¦ππ«π€) π foreign key (cid) references customer (cid) (π π¦ππ«π€) π on delete cascade on update cascade, (π π¦ππ«π€) π foreign key (upid) references unit_price (upid) (π π¦ππ«π€) π on delete cascade on update cascade); (π π¦ππ«π€) III. (b) π 1. select cname (π π¦ππ«π€) π from customer (π π¦ππ«π€) π where address = ‘SanChaung’; (π π¦ππ«π€) 2. select type, count(ranges) (π π¦ππ«π€) from meter_box as M, unit_price as U (π π¦ππ«π€) π where M.mbid= U.mbid (π π¦ππ«π€) π group by M.type; (π π¦ππ«π€) π 3. select customer.cname ; ( π¦ππ«π€) π π from customer, receipt; (π π¦ππ«π€) π where receipt.cid=customer.cid; (π π¦ππ«π€) π and amount > 30000; (π π¦ππ«π€) π 4. update unit_price (π π¦ππ«π€) π set price=100 (π π¦ππ«π€) π where ranges = ‘75-100’(π π¦ππ«π€) and mbid = (select mbid from meter_box where type= ‘business’); (π π¦ππ«π€) π 5. update customer (π π¦ππ«π€) π set address =‘NorthDagon’(π π¦ππ«π€) π where address =‘SanChaung’; (π π¦ππ«π€) π 6. delete(π π¦ππ«π€) π from receipt (π π¦ππ«π€) where dueDate < ‘2023-03-31’; (π π¦ππ«π€) π π 7. select meter_box.type(π π¦ππ«π€), unit_price.ranges (π π¦ππ«π€) from meter_box, unit_price, receipt(π π¦ππ«π€) π where receipt.upid=unit_price.upid( π¦ππ«π€) π π and receipt.mbid=meter_box.mbid(π π¦ππ«π€) π and unit_price.price between 50 and 70; (π π¦ππ«π€) π 8. create view Below30 as (π π¦ππ«π€) π (select customer.cname, customer.address(π π¦ππ«π€) π from customer, meter_box, unit_price, receipt(π π¦ππ«π€) π where customer.cid=receipt.cid(π π¦ππ«π€) π and meter_box.mbid=receipt.mbid(π π¦ππ«π€) π and unit_price.upid=receipt.upid(π π¦ππ«π€) π and useunit < 30(π π¦ππ«π€) π and type= ‘domestic’); (π π¦ππ«π€) 9. create user Smith@localhost (π π¦ππ«π€) identified by ‘Smith123’; (π π¦ππ«π€) 10. grant select (1 π¦ππ«π€) π on Below30 (π π¦ππ«π€) π to Smith@localhost; (π π¦ππ«π€) IV. (a) student sid s_name program coruse_offerings time sec_no room year semester enrols grade teaches instructor iid i_name dept title is offered course course_no syllabus title credits IV. (b) (1 mark) (1 mark) (1 mark) instructor student IID Iname SID Sname advise π (π π¦ππ«π€) π (π mark) (1 mark) IV. (c) (1 mark) (1 mark) country capital Country_ID Country_name π (π π¦ππ«π€) V. Capital_ID Capital_name has π (π mark) (a) 1. This table is unnormalized table. (1 mark) 2. It is necessary to further normalize the generated tables from question (1) to1NF (1 mark) because this table has multiple value. (1 mark) EmployeeCode EmployeeName ProjectName 101 Jolly Project101 (π mark) 101 Jolly Project102 102 Rehan Project103 102 Rehan Project104 3. It is necessary to further normalize the generated tables from question () to 2NF (1 mark)because this table has partial dependency. (1 mark) Employee_Project table Employee table EmployeeCode ProjectCode EmployeeCode EmployeeName 101 P1 (π mark) 101 P2 102 P3 102 P4 Project table ProjectCode P1 Project101 (π mark) Project102 P3 Project103 P4 Project104 Jolly 102 Rehan (π mark) ProjectName P2 101 V. (b) 1. Closure {id, name}+ π 1. result ={id, name}(πmark) π 1st loop for 3 times, (πmarks) 1. id→name, gender 2. name→gender 3. age, DOB→gender result = {id, name, gender} no change no change π (π π mark) π 2nd loop for 3 times, (πmarks) 1. id→name, gender 2. name→gender 3. age, DOB→gender no change no change no change π (π π mark) π So, {id, name}+ = {id, name, gender}(πmarks) 2. Show that the FD id, DOB→gender holds for 1. id→name, gender 2. id, DOB→name, gender, DOB (1 mark) 3. id, DOB→gender(1 mark) (given) (1 mark) (1, Augmentation) (1 mark) (2, Decomposition) (1 mark)