You are on page 1of 3

M S ENGINEERING COLLEGE, BANGALORE

Title: Internal Assignment – II

Department of Computer Science & Engineering


Semester: V A & B
Subject: DBMS Assigned Date: 23.02.2024
Subject Code: 21CS53 Submission Date: 10.03.2024

MODULE 2 Classification
As per Blooms
Questions Taxonomy
Consider the following company database.
1. L3
Emp (name, ssn, salary, superssn, gender, dno)
Dept (dnum, dname, mgrssn)
Dept_loc (dnum, dlocation)
Dependent (essn, pno, hours)
Project (pname, pnumber, plocation,dnum)

Write SQL queries for the following:

i) Retrieve the name of all employee who work with the same department as Shravan.
ii) Retrieve the name and no of dependents for an employee Chandan.
iii) Retrieve the names of managers working in location sadahalli and has no female
dependents.
iv) List female employees from dno=25 earning more than 50000
v) List CSE department details.
vi) Retrieve all the employee name who is working on all the projects in which John Smith
works.
Retrieve all the project numbers along with number of employee working on each project
Given the schema:
2. L3
Passenger (pid, pname, pgender, pcity)
Agency (aid, aname, acity)
Flight (fid, fdate, time, src, dest)
Booking (pid, aid,fid, fdate)

Give relation algebra expression for the following:


i) Get the complete details of all flights to new delhi
ii) Find only the flight numbers for passengers with pid 123 for flights to Chennai before
06/11/2020
iii) Find the passenger names for those who do not have any bookings in any flights.
iv) Get the details of flights that are scheduled on both dates 01/12/2020 and 02/12/2020 at
16:00 hours.
v) Find the details of all male passengers who are associated with jet agency.

Explain cursors and its properties in embedded SQL with suitable example.
3. L2
How are assertions and triggers defined in SQL. Explain with an example.
4. L2

5. Illustrate atleast 5 types of Alter and drop commands in SQL. L3

6. Describe the process of insert, updating and delete records in a SQL, and discuss the potential L2
challenges associated with insert, update and delete operations.
Provide examples to illustrate each.
7. Describe the role of aggregate, Set Theory and rename in the context of SQL. L2

How do SQL operations relate to set operations?


Provide examples to illustrate each.
Given the schema and write the SQL queries
8. L3
EMP (Fname, Lname, SSN, Bdate, Address, Gender, Salary, Super SSN, Dno)
DEPT (Dname, Dnumber, Mgr_SSN, Mgrstartdate)
DEPT_LOC (DNumber, Dloc)
PROJECT (Pname, Pnumber, Ploc, Dnum)
WORKS_ON (WSSN, Pno, Hours)
DEPENDENT (ESSN, Dept_name, Gender, Bdate, relation)
i) Retrieve the employee details whose salary is 30000.
ii) Retrieve the employee names who work in AIML department.
iii) Retrieve the pno, pname, no. of man hours work done on each project.
iv) Retrieve the pname which are controlled by Research department.
v) Retrieve the department name who work for dept number 10.
vi) Retrieve the average salary of employees
vii) Update the salary of employee by 10% who work in dno 10
Consider the following Supplier Database schema: Solve using SQL
9. L3
SUPPLIERS (sid: integer, sname: string, address: string)
PARTS (pid: integer, pname: string, color: string)
CATALOG (sid: integer, pid: integer, cost: real)
1. Insert at least 5 values for each table.
2. Retrieve all supplier names (sname) along with their corresponding addresses.
3. Find the names and colors of all parts.
4. List the suppliers who supply a part with a specific pid (e.g., pid = 101)
5. Retrieve the names of all parts supplied by a specific supplier (e.g., sid = 1).
6. Display the catalog entries along with the corresponding supplier names and part
names
7. Retrieve the part names (pname) and their corresponding colors for parts supplied by
a specific supplier (e.g., sid = 2)
8. List the suppliers who supply parts in a specific color (e.g., color = 'Red').
With an example explain stored procedures in SQL.
10. L2
Explain types of JDBC drivers. L2
11.

Module - 4

List the informal design guidelines to create a well-structured relation schema.


1. L2
Can you recall the primary purpose of normalization in database design?
2. L2
3. Define Functional dependences with example. Explain 1NF, 2NF,3NF. L2
Write the algorithm to find the minimal cover for a sets of FD’s Consider R= {A, B, C, D, E, F} .
4. L3
FD’s { A->C, AC->D, E->AD, E->H }
Find the irreducible cover for this set of FD’s (minimal cover)
Given below are two sets of FD’s for a relation R (A, B, C, D, E).
5. Are they equivalent? L3
F={A->C, AC->D, E->AD, E->H } and
G={ A->CD, E->AH }

Construct minimal cover m for set of functional dependencies which are:


6. L3
E:{A→C, AC→D, E→AD, E→H}

Consider the relation schema R(A, B, C, D, E, F) and the functional dependencies


6. A->B, C->DF, AC->E, D->F. L3
What is the primary key of this relation R?
What is its highest normal form?
Preserving the dependency, decompose R into third normal form.

Consider the schema R=A B C D E F G H I J, subjected to FDS,


7. L3
F= {AB→C, A→DE, B→F, F→GH, D→H},
and the non binary partition
D1= {ABCDE, BFGH, DIJ}.
State whether D1 is a lossless decomposition?

Module - 5

Define transaction. Discuss ACID properties.


1. L2
With a neat diagram, explain transition diagram of a transaction.
2. L2
What are the anomalies occur due to interleave execution. Explain them with example.
3. L2
Write short notes on the following :
4. L2
a. transaction support in SQL

Explain multi version concurrency control protocols.


5. L2
Briefly discuss on the two phase locking protocol used in concurrency control. How does it
6. L2
guarantee serializability.

You might also like