9.3 KB · commit 40bb182
Department of Electrical & Computer Engineering
Course No: ECE 2215
Course Title: Database Systems
| Question No. | Question Description | Marks |
|---|---|---|
| Q.1 (a) | What are the five main functions of a database administrator? What is relation schema? | 05 |
| Q.1 (b) | Differentiate between the two-tier architecture and three-tier architecture of database. Which is better suited for web application? Why? | 03 |
| Q.1 (c) | What is mapping cardinalities? Define different types of cardinalities. | 04 |
| Question No. | Question Description | Marks |
|---|---|---|
| Q.2 (a) | Consider the following relation schema: person(id, name, age) vaccine(id, center, dose_no, date) Now give expression in relational algebra to express- (i) Find the names of all persons who are adult. (ii) Find the names of all persons who have taken the 1st dose only. (iii) Find the details of all persons who were given vaccine from "RMC" center and completed 2nd dose. | 06 |
| Q.2 (b) | Write short note about: Super Key, Candidate Key, Primary Key, and Foreign Key. | 04 |
| Q.2 (c) | Explain the difference between a weak and a strong entity set with appropriate example. | 02 |
| Question No. | Question Description | Marks |
|---|---|---|
| Q.3 (a) | What is aggregation in ER-model design? | 02 |
| Q.3 (b) | Consider the following company database schema. employee(ssn, fname, lname, DoB, Address, Sex, Salary, dept_no) department(dnumber, dname, mgr_ssn, mgr_start_date) dept_location(dnumber, dlocation) project(pnumber, pname, dnum) works_on(essn, pno, hours) dependent(essn, dependent_name, Sex, DoB, relationship) Now write down the MySQL query for the followings. (i) For each department whose average salary is more than $30,000, retrieve the department_name and the number of employees working for that department. (ii) Find the names of all employees who are working on project number "5" and are from the same department. (iii) Find the number of dependent people of those employees who are from "H&R" department. | 10 |
| Question No. | Question Description | Marks | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Q.4 (a) | What is an SQL injection attack? Explain how it works and what precautions must be taken to prevent SQL injection attack. | 04 | |||||||||||||||||||||||||||
| Q.4 (b) | Let that, R=(A,B,C) and r1, r2 both be relations on the schema R. Give an expression in the domain relational calculus that is equivalent to each of the followings. (i) πA(r1) (ii) r1∪r2 (iii) r1∩r2 | 03 | |||||||||||||||||||||||||||
| Q.4 (c) | Consider the following tables:
What will happen when the following actions will be performed on these two relations? (i) Natural Join (ii) Left Outer Join (iii) Right Outer Join (iv) Full Outer Join | 05 |
| Question No. | Question Description | Marks |
|---|---|---|
| Q.5 (a) | Differentiate between- (i) Simple and composite attribute (ii) Single-valued and multi-valued attribute | 04 |
| Q.5 (b) | What is a transaction? Describe the life cycle of a transaction. | 04 |
| Q.5 (c) | Draw a concurrent schedule equivalent to serial schedule. Prove its step by step swapping process. | 04 |
| Question No. | Question Description | Marks | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Q.6 (a) | Which of the following schedule is (conflict) serializable? For each serializable schedule, determine the equivalent serial schedules. (i) r1(X);r3(X);w1(X);r2(X);w3(X) (ii) r1(X);r3(X);w3(X);w1(X);r2(X) | 06 | ||||||||||||||||||
| Q.6 (b) | What is view serializability? Why do we need view serializability? Check the view serializability of the following schedule if any.
| 06 |
| Question No. | Question Description | Marks |
|---|---|---|
| Q.7 (a) | What is deadlock? Describe the time-shared locking protocol with example. | 04 |
| Q.7 (b) | Define RDMS. Consider the following insurance database where the primary keys are underlined. Person(driver_id, name, address) Car(license, model, year) Accident(report_no, date, location) Owner(driver_id, license) Participated(driver_id, report_no, car, damage_amount) Write MySQL for the following queries- (i) Find the number of accidents in which the cars belonging to "John Smith" were involved. (ii) Add a new accident to the database, assuming any values for required attributes. (iii) Update the car "Mazda" belonging to "John". (iv) Update the damage amounts $3000 for the car with license number "YJK-100" in the accident with report number "APR2197". (Note: Printed as "RDMS" in original question paper; refers to "RDBMS") | 08 |
| Question No. | Question Description | Marks | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Q.8 (a) | What is triggering? What are the purposes of using triggering? Write the syntax for creating a trigger. | 04 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Q.8 (b) | Consider the given structure below:
(i) Identify the anomalies in the given structure. (ii) Normalize it up to third Normal Form (3NF). (Note: In the original examination paper, "Hrs. Billed" is printed as "Hrs. Biller.", and the Proj. Num. and Proj. Name cells span both employee rows for each project) | 08 |