The document describes the requirements for a database to support an online bus ticket booking website. It outlines the key entities like users, buses, bus trips, tickets, and their attributes. It also describes the relationships between these entities like users booking tickets, buses undertaking trips, and tickets being issued for trips. The goal of the database is to store information about users, buses, trips, tickets and their bookings while supporting features like loyalty points and owners selling tickets.
The document describes the requirements for a database to support an online bus ticket booking website. It outlines the key entities like users, buses, bus trips, tickets, and their attributes. It also describes the relationships between these entities like users booking tickets, buses undertaking trips, and tickets being issued for trips. The goal of the database is to store information about users, buses, trips, tickets and their bookings while supporting features like loyalty points and owners selling tickets.
The document describes the requirements for a database to support an online bus ticket booking website. It outlines the key entities like users, buses, bus trips, tickets, and their attributes. It also describes the relationships between these entities like users booking tickets, buses undertaking trips, and tickets being issued for trips. The goal of the database is to store information about users, buses, trips, tickets and their bookings while supporting features like loyalty points and owners selling tickets.
The document describes the requirements for a database to support an online bus ticket booking website. It outlines the key entities like users, buses, bus trips, tickets, and their attributes. It also describes the relationships between these entities like users booking tickets, buses undertaking trips, and tickets being issued for trips. The goal of the database is to store information about users, buses, trips, tickets and their bookings while supporting features like loyalty points and owners selling tickets.
B.TECH/CSE/5TH SEM/CSEN 3102/2018 (vi) In a relation R, a multivalued dependency AB is non-trivial one if DATABASE MANAGEMENT SYSTEMS (a) A ∩ B = Φ (b)B U A=R (CSEN 3102) (c) R-(B U A) is not null, i.e., non-empty. (d)None of these. Time Allotted : 3 hrs Full Marks : 70 (vii) A decomposition of R to R1 and R2 is lossy-join decomposition if Figures out of the right margin indicate full marks. (a) common attributes between R1 and R2 form a super key of neither R1 nor R2. Candidates are required to answer Group A and (b) common attributes between R1 and R2 form a super key of both any 5 (five) from Group B to E, taking at least one from each group. R1 and R2. Candidates are required to give answer in their own words as far as (c) common attributes between R1 and R2 form a super key of R1, but not practicable. of R2. (d) common attributes between R1 and R2 form a super key of R2 but Group – A not of R1. (Multiple Choice Type Questions) 1. Choose the correct alternative for the following: 10 × 1 = 10 (viii) The following SQL on relation Borrower(customer_id, loan_id)and Depositor(customer_id, account_id) select * from borrower where (i) If in a relation R(X,Y), the functional dependencies XY and YX hold, then customer-id not in(select * from Depositor) will produce an output: it implies ____________ association between and X and Y (a) all customers who have loan in the bank only (a) many to many (b) one to many (c) many to one (d) one to one. (b) all customers who have account in the bank only (ii) In an RDBMS, which of the following statements about WeakEntities and (c) all customers who have both loan and account in the bank TotalParticipation is true? (d) error. (a) Total Participation guarantees Weak Entity (ix) In 2-phase locking protocol, which of the following locks are compatible? (b) Weak Entity must have Total Participation (a) Read-lock(A) by T1 transaction and write-lock(A) by T2 transaction (c) Weak Entity may not have Total Participation (b) Write-lock(A) by T1 transaction and write-lock(A) by T2 transaction (d) Total Participation will never be applicable for Weak Entities. (c) Write-lock(A) by T1 transaction and read-lock(A) by T2 transaction (iii) Consider a schedule S1 which is conflict serializable. Which of the following (d) Read-lock(A) by T1 transaction and read-lock(A) by T2 transaction is false? (a) S1 is always view serializable (b) S1 may not be view serializable (x) For a relation R= { J, K, L } with functional dependencies (c) S1 is equivalent to at least one serial schedule (d) cannot comment. F = { JK –>L L –> K }, the candidate keys are : (iv) Consider the following DDL statement: (a) J and K (taken separately) (b) JK (taken together) Create table Employee(empId number(5) primary key, salary (c) only J (d) JK and JL. number(10,2), deptno number(5) references Department(deptId)); Group – B Which of the following is true: (a) deptId of Department table must be a foreign key 2. Consider the requirements of database of an online bus ticket booking website (b) deptId of Department table must be candidate key as following: (c) deptno of Employee table must be a primary key Each user must register with the website using a unique email id and a unique (d) None of these. mobile number along with other personal details like name, age, gender and (v) Which of the following statements is true? address. Only registered customer can book any bus ticket at the website. (a) Isolation property of a transaction can always be achieved for any Each bus has a unique vehicle number. Each bus has a model name, number of possible concurrent schedule of execution of transactions. seats, manufacturing year, date of vehicle registration, etc. A bus can undertake (b) Atomicity ensures proper normalization of tables used in a transaction. several bus trips, where each trip will be conducted on a specific bus route. A (c) Consistency property can never be achieved if isolation property also bus trip has a unique Trip_id, along with the start time and date of journey. A holds simultaneously. bus route has unique route_no, a source stop, a terminal stop and total distance. (d) Durability property of a transaction can be achieved by using appropriate log-based recovery scheme along with regular database backup in stable storage. CSEN 3102 1 CSEN 3102 2 B.TECH/CSE/5TH SEM/CSEN 3102/2018 B.TECH/CSE/5TH SEM/CSEN 3102/2018 Ticket of a particular bus trip is issued for reserving seat from the source to (c) Write Relational Algebra Expressions for the following problems: terminal stop only. On basis of availability of seats for a particular bus trip, a I. List the Trip ID, dates, amounts, destination city, departure date, and return ticket with unique ticket number will be issued for seat reservation of one or date for employee “Kunal Shah”. many passengers. During booking of a ticket, only the name and age of each II. List out ALL employee names and phone numbers from the “Accounting” passenger must be provided. A passenger does not require any user department who have not travelled. registration with the website in order to travel using a valid ticket, in the form III. List out ALL employee names who have travelled to “Kolkata” at least twice. of a printout or an SMS. Based on total booking amount for a particular ticket, a certain loyalty reward points will be added to the corresponding registered 1 + 2 + (3 3)= 12 user account, which has been used for booking the ticket. 5. (a) Why is normalization of database required? Bus owners, registered with the website, are only allowed to sell ticket of different trips of their bus/buses, through reservation process of the website. (b) What is partial functional dependency? Information of bus owner such as name, address, unique mobile number, (c) Consider a relation R1 (A, B, C, D) on which the following FDs are applicable: unique email, etc are also maintained in the system. AB C; B D. Explain with a suitable case/scenario how insertion anomaly (a) Based on the above problem statement, design an Entity Relationship Diagram, can affect this relation R1. that should have (d) Consider a relation R2 (X, Y, Z) on which the following FDs are applicable: at least 6 strong entities appropriately chosen, XY; Y Z. Explain with a suitable case/scenario that how deletion anomaly at least 1 weak entity appropriately chosen can affect this relation R2. all necessary relationships among these entities and corresponding 2+ 2 +4 + 4 = 12 cardinalities, as per given requirements Group – D (b) List all the non-trivial functional dependencies that can be obtained from the 6. Consider the following tables of a database of a computer training institute: above mentioned requirements of online bus ticket booking problem. STUDENT (rollno, name, courseId, yearOf_enroll); COURSE (courseId, 8 + 4 =12 courseName), SUBJECT_PAPER(pcode, pname, courseId) ; 3. (a) By using a single illustrative example define and explain the terms, Primary MARKS_OBTAINED(rollno, pcode, yearOfexam, marks), FACULTY (empid, Key, Candidate Key, Foreign Key, Alternate Key and Super Key. Also, name, salary), SUBJECT_TAUGHT (empid, pcode, courseId, year Of_teaching) highlight the difference between a Primary Key and a Unique Key. Write the SQL for the following queries using the given tables: (b) Explain what DDL, DML, DCL are. Give an example of each. (c) Discuss the different types of Constraints that should be present in a good (i) Display the course name along with course id, in which maximum number of database design. students have enrolled in the year 2018. (d) By using a single illustrative example bring out the difference between Left (ii) Display the name with employee id of those faculties, who have been Outer Join, Right Outer Join, and Full Outer Join. teaching at least three papers in the year 2018. (iii) For each paper, display the paper name and the corresponding average of 3 + 3 + 3 + 3= 12 the paper’s marks, obtained by those students, who have appeared for its Group – C exam in the year 2017. 4. Consider the Relational Schema given below: 3 4 = 12 EMPS (Aadhaar, Name, Address, Phone, Deptno, JobTitle, Salary) 7. Consider the relation T(A,B,C,D,E,F) and the following set of functional CITY (PIN, City, State) dependencies F = {AFB; BDC; CEA, AF; BD; CE, FD; DE}. DEPTS (Deptno, DeptName, DeptMgrAaadhaar) (i) Determine the highest normal form of relation T with respect to the TRIPS (TripId, DestinationCity, DepartureDate, ReturnDate, Aadhaar) given F; justify your answer with proper reasons. EXPENSES (TripId, Item, Date, Amount) (ii) If T is not in 3NF, then normalize it to 3NF first and then further (a) Suggest the Primary Keys for the relations TRIPS and EXPENSES. normalize it to BCNF. (b) Find out all the Foreign Keys for the given schema and show them by drawing 6 + 6 = 12 arrows to their corresponding relation and attribute.
CSEN 3102 3 CSEN 3102 4
B.TECH/CSE/5TH SEM/CSEN 3102/2018 B.TECH/CSE/5TH SEM/CSEN 3102/2018 Group – E 8. Consider two transactions T1 and T2 with following database operations: T1: R1(A) W1(A) R1(B) W1(B) T2: R2(A) W2(A) R2(C) W2(C) where, Ri(x) and Wi(x) are read and write operations of Ti on data item x respectively. S = R1(A) R1(B) W1(A) R2(A) W2(A) W1(B) R2(C) W2(C) (a) Is it possible to execute the given concurrent schedule S using 2-phase locking protocol? Justify your answer. (b) Every conflict serializable schedule is also a view serializable , but all view serializable schedules are not conflict serializable; justify this statement 6 + 6 =12 9. Write short notes on any three of the following: (i) B+ Tree Database Indexing (ii) Cost-based Query Optimization. (iii) ACID properties (iv) TimeStamp-based Protocol (v) Weak Entity Set 3 4=12