Database Management Systems ESA Dec 2024
Database Management Systems ESA Dec 2024
1.c. Exemplify the steps of mapping from E-R diagram into a relational
model? (5.0 Marks)
about:blank 1/7
3/25/25, 4:04 PM ESA - Dec 2024 - UE22CS351AX (set- 1)
about:blank 2/7
3/25/25, 4:04 PM ESA - Dec 2024 - UE22CS351AX (set- 1)
(6.0 Marks)
2.c. What are integrity constraints in SQL? Explain the different types of
constraints (PRIMARY KEY, FOREIGN KEY, UNIQUE, NOT NULL, CHECK)
with examples. (10.0 Marks)
about:blank 3/7
3/25/25, 4:04 PM ESA - Dec 2024 - UE22CS351AX (set- 1)
2.d. What do you mean by views in SQL? Is the view table contents are
precomputed and stored? Illustrate views with an example (3.0 Marks)
3.a. What is the process to determine whether the given two sets of
Functional dependencies, say F and G are Equivalent?(3M)
Consider the relation R(A,B,C,D) having two FD sets
FD1 = {A->B, B->C,A->C} and
FD2 = {A->B, B->C, A->D}.
Determine whether FD1 and FD2 are Equivalent in detailed list of steps.
(5M) (8.0 Marks)
3.b. Give the algorithm to find the minimal cover of a set of functional
dependencies.(2M)
Find the minimal cover of the set of functional dependencies given;
{A → C, AB → C, C →DI, CD → I, EC → AB, EI → C} (5M) (7.0 Marks)
about:blank 4/7
3/25/25, 4:04 PM ESA - Dec 2024 - UE22CS351AX (set- 1)
3.c. Illustrate and explain the first normal form(1NF), general definition of
second normal form (2NF) and general definition of third normal
form(3NF) with an example for each of them. (6.0 Marks)
about:blank 5/7
3/25/25, 4:04 PM ESA - Dec 2024 - UE22CS351AX (set- 1)
4.c. Consider the below given schedule and check whether the given
schedule is conflict serializable by listing all the conflicting operations and
drawing the precedence graph.
(4.0 Marks)
4.d. Explain neo4j data model and write the following queries using neo4j-
cypher query language (4M)
i. create a node with label ‘Book’ and a set of properties as follows:
title: Database
edition: seven
publisher: pearson (2M)
ii. Update the title of the book from ‘Database’ to ‘Database system’(1M)
iii. Remove the node with the label book if the title is ‘Database
system’(1M) (8.0 Marks)
about:blank 6/7
3/25/25, 4:04 PM ESA - Dec 2024 - UE22CS351AX (set- 1)
about:blank 7/7
3/25/25, 4:04 PM ESA - Dec 2024 - UE22CS351A (set- 1)
1.a. Discuss the main characteristics of the database approach and how it
differs from traditional file systems. (5.0 Marks)
about:blank 1/10
3/25/25, 4:04 PM ESA - Dec 2024 - UE22CS351A (set- 1)
about:blank 2/10
3/25/25, 4:04 PM ESA - Dec 2024 - UE22CS351A (set- 1)
about:blank 3/10
3/25/25, 4:04 PM ESA - Dec 2024 - UE22CS351A (set- 1)
about:blank 4/10
3/25/25, 4:04 PM ESA - Dec 2024 - UE22CS351A (set- 1)
about:blank 5/10
3/25/25, 4:04 PM ESA - Dec 2024 - UE22CS351A (set- 1)
2.c.
Determine the number of rows and the output for each SQL query given
below.
1. SELECT AVG (cost) FROM Catalogue WHERE pno = ‘P4’ GROUP
BY(pno);
2. SELECT [Link],[Link] FROM Supplier s , Catalogue c WHERE cost>
(SELECT AVG (cost) FROM Catalogue WHERE pno = ‘P4’ GROUP
BY(pno));
3. SELECT [Link],[Link] FROM Supplier s , Catalogue c WHERE
[Link]=[Link];
4. SELECT [Link], [Link],[Link],[Link] FROM Suppliers s,
Catalogue c WHERE [Link]=[Link] AND [Link] > (SELECT AVG (cost)
FROM Catalogue WHERE pno = 'P4' GROUP BY(pno)) ;
(4.0 Marks)
about:blank 6/10
3/25/25, 4:04 PM ESA - Dec 2024 - UE22CS351A (set- 1)
.
Find the minimal cover of the given set of functional dependencies F.
(6.0 Marks)
about:blank 7/10
3/25/25, 4:04 PM ESA - Dec 2024 - UE22CS351A (set- 1)
3.c. Consider the following four relational schemas. For each schema, all
non-trivial functional dependencies are listed. The underlined attributes
are the respective primary keys.
Which one of the above relational schema is in 3NF but not in BCNF?
Justify (8.0 Marks)
about:blank 8/10
3/25/25, 4:04 PM ESA - Dec 2024 - UE22CS351A (set- 1)
4.a. Consider the read and write operations respectively on a data item x
and y by a transaction T1 and T2. Consider the following two schedules S1
and S2
Schedule S1 Schedule S2
4.b. Identify the appropriate minimum transaction isolation level for the
scenarios described below. Justify your choice by explaining the specific
problem that arises in each case.
Scenario 1:
A bank application allows two clerks to update the balance of a
customer’s account simultaneously. The current balance is ₹10,000.
Clerk A withdraws ₹5,000 and Clerk B deposits ₹3,000.
Both transactions execute at the same time.
Scenario 2:
In a university database, Transaction 1 queries the list of students in a
class. Before Transaction 1 completes, Transaction 2 adds a new student
and commits.
Transaction 1 re-queries and finds a new student in the list.
How can you prevent this inconsistency?
Scenario 3:
A retail system has two transactions:
Transaction 1 updates a product's stock quantity but is not yet
committed.
Transaction 2 reads the stock quantity to place an order.
If Transaction 1 is rolled back, but Transaction 2 already used the
uncommitted data, what could happen? Which isolation level can prevent
this?
Scenario 4:
A sales application reads the price of a product in Transaction 1. Before
Transaction 1 completes, Transaction 2 updates the price and commits.
Transaction 1 reads the price again and finds it has changed.
Which isolation level would prevent this issue?
(8.0 Marks)
about:blank 9/10
3/25/25, 4:04 PM ESA - Dec 2024 - UE22CS351A (set- 1)
about:blank 10/10
3/25/25, 4:26 PM ESA - Dec 2024 - UE21CS351A (set- 1)
1.b. How the file processing is so complex? how the database overcomes
the limitations in the file processing system? (5.0 Marks)
about:blank 1/5
3/25/25, 4:26 PM ESA - Dec 2024 - UE21CS351A (set- 1)
2.b. What are the set operations? Illustrate with sql query. (7.0 Marks)
about:blank 2/5
3/25/25, 4:26 PM ESA - Dec 2024 - UE21CS351A (set- 1)
2.c. Illustrate nested query in select clause, from clause, and from where
clause. (8.0 Marks)
2.d. what is trigger? Create a trigger that checks if the entered marks are
valid or not whenever an entry is made in the Marks_sample table.
(5.0 Marks)
3.a. Show that the following two sets of FDs are equivalent:
F = {A → C, AC → D, E → AD, E → H} and
G = {A → CD, E → AH}
Which of the following holds true?
(A) G ⊇ F
(B) F ⊇ G
(C) F = G
(D) All of the above (15.0 Marks)
about:blank 3/5
3/25/25, 4:26 PM ESA - Dec 2024 - UE21CS351A (set- 1)
3.b. What is 3NF? Consider the following scheme, key and FDs. Check the
table is in 3NF. If not, convert into 3NF.
Scheme = {Title, PubID, PageCount, Price }
[Link] -> {Title, PubId}
2.{Title, PubId} -> {PageCount}
3.{PageCount} -> {Price} (10.0 Marks)
about:blank 4/5
3/25/25, 4:26 PM ESA - Dec 2024 - UE21CS351A (set- 1)
about:blank 5/5
PES University, Bengaluru
(Established under Karnataka Act 16 of 2013)
Note:
acct_id is primary key for account relation
loan_id is primary key for loan relation
Write the relational algebraic queries for the following:
1. Fetch the account id’s of all accounts with the balance of Rs 300 or more. (1M)
2. Find the names of all the customers with loans using join operation. (1M)
3. Find the names of all the customers who have either a bank account or a loan
account in the bank (use set operation) (2M)
4. Find the all the customers who have a bank account without load (use set
operation) ( 2M)
(6.0 Marks)
3.a. What is the process to determine whether the given two sets of
Functional dependencies say F and G are equivalent?( 2 Marks)
Consider the relation R(A,B,C,D) having two FD sets FD1={A->B, B->C, A->C}
and FD2={A->B,B->C,A->D}. Determine whether FD1 and FD2 are equivalent in
detailed list of steps (4 Marks) (6.0 Marks)
3.c. Illustrate and explain the first normal form, general definition of second
normal form and general definition of third normal form with an example for each.
(2+3+3). (8.0 Marks)
3.d. i)Given relational schema R( P Q R S T U V) with a set of functional dependency
denoted by
FD = { P->Q, QR->ST, PTU->V }.
Determine Closure of (QR) and (PR) (2M)
1.b. Mention the steps in converting ER Diagram to Relational Schema (6.0 Marks)
1.c. XYZ Hospitals is a large medical facility that provides a wide range of
healthcare services to patients. The hospital's administration wants to implement a
new database system to manage various aspects of its operations, including
patient records, medical staff, appointments, treatments, and billing. The database
will help streamline processes, improve data accuracy, and ensure compliance with
healthcare regulations.
Draw the ER Diagram by identifying entities, relationships, and attributes clearly,
ensuring that all connections reflect the hospital's workflow accurately. (8.0 Marks)
1.d. Describe three schema architecture with neat diagram. (5.0 Marks)
2.a. Write about any two Aggregate functions in SQL with suitable queries.
(4.0 Marks)
2.b.
Given the schema
EMP ( Fname, Lname, SSN, Bdate, Address, Sex, Salary, SuperSSN, Dnumber)
DEP T(Dname, Dnumber, MgrSSN, MGrstartdate)
DEPT-LOC (Dnumber,Dloc)
PROJECT(Pname, Pnumber, Ploc,Dnumber)
WORKS-ON (ESSN,PNo,Hours)
Give the relation algebra expression for the following:
i. List first name, last name of female employees from Dnumber=20 earning less
than 50000
ii. Retrieve the first name, last name and salary of all employees who work in
departmental number 50.
iii. Retrieve the first name, last name of the manager of each department.
iv. Retrieve the name and address of all employees who work for sports
department.
(8.0 Marks)
2.c. Consider the following tables:
Employee (Emp_no, Name, Emp_city)
Company (Emp_no, Company_name, Salary)
i. Write a SQL query to display Employee name and company name. (2M)
ii. Write a SQL query to display employee name, employee city, company name
and salary of all the employees whose salary >10000 (3M)
iii. Write a query to display name all the employees working in ‘XYZ’ company.(3M)
(8.0 Marks)
2.d. What are Triggers and stored procedures in SQL? Explain each with
appropriate examples (5.0 Marks)
3.a. A relation R has four attributes ABCD. For the following sets of Function
Dependency(FD), identify the candidate key and the highest normal form:
i. FD= { C →D,
C→A,
B→C } (4.0 Marks)
3.b. List and explain in two to three lines each of the ACID properties? (5.0 Marks)
3.c. Illustrate and explain the first normal form(1NF), general definition of second
normal form (2NF) and general definition of third normal form(3NF) with an
example for each of them. (8.0 Marks)
(8.0 Marks)
4.c. With respect to Neo4j Data model define with suitable exapmle the :
i. Nodes [2M]
ii. Properties [2M]
iii. Relationships[2M] (6.0 Marks)
1.b. List the three levels of data abstraction. Briefly explain what happens
at each level. (6.0 Marks)
about:blank 1/7
11/8/24, 12:44 PM ESA - DEC 2023 - Minor - UE21CS351AX (set- 1)
about:blank 2/7
11/8/24, 12:44 PM ESA - DEC 2023 - Minor - UE21CS351AX (set- 1)
about:blank 3/7
11/8/24, 12:44 PM ESA - DEC 2023 - Minor - UE21CS351AX (set- 1)
2.d. Map the BANK ER schema shown in Figure into a relational schema
diagram. Specify all primary keys and foreign keys.
Write a SQL CREATE statement for the entity LOAN.
(7.0 Marks)
3.a. IR1, IR2, IR3 form a sound and complete set of inference rules called
Armstrong's inference rules.
Describe each rule with proper notations and an example each.
(6.0 Marks)
about:blank 4/7
11/8/24, 12:44 PM ESA - DEC 2023 - Minor - UE21CS351AX (set- 1)
3.d. Enumerate the five transaction states describing each one with 1-2
sentences each.
Draw a state transition diagram of a transaction. (7.0 Marks)
about:blank 5/7
11/8/24, 12:44 PM ESA - DEC 2023 - Minor - UE21CS351AX (set- 1)
about:blank 6/7
11/8/24, 12:44 PM ESA - DEC 2023 - Minor - UE21CS351AX (set- 1)
about:blank 7/7
11/8/24, 12:44 PM ESA - DEC 2023 - UE21CS351A (set- 2)
1.a. Define Data abstraction [2 marks] and Define Data model [1 mark].
Identify the data model for the following figure [1 marks] and discuss
important points with respect to identified data model [4 marks].
Figure:
(8.0 Marks)
about:blank 1/6
11/8/24, 12:44 PM ESA - DEC 2023 - UE21CS351A (set- 2)
1.b. What are parallel databases [1 mark] and discuss any two
architectural designs for parallel DBMS with neat diagram [4 marks].
(5.0 Marks)
1.c. You are given the following requirements for a simple database for
the National Hockey League (NHL):
1. the NHL has many teams,
2. each team has a name, a city, a coach, a captain, and a set of players,
3. each player belongs to only one team,
4. each player has a name, a position (such as left wing or goalie), a skill
level
5. a team captain is also a player
6. a game is played between two teams (referred to as host_team and
guest_team) and has a date (such as May 11th, 2019) and a score
(such as 4 -2)
Construct a clean and concise ER diagram for the NHL database. List your
assumptions and clearly indicate the cardinality mappings, participation
constraints in your ER diagram.[6 marks]
Convert the NHL ER diagram to relational mapping and mention the steps
used for conversion clearly. [6 marks] (12.0 Marks)
i) list the author details who are expert in Pattern Recognition and live in
Bengaluru.
ii) list the titles of the books which are written by Stallings and have either
380 pages or cost Rs.450.
iii) display author names, who have authored books on OS and DS as well.
(6.0 Marks)
about:blank 2/6
11/8/24, 12:44 PM ESA - DEC 2023 - UE21CS351A (set- 2)
2.c. Consider the below employee database, where the primary keys are
underlined. Give an expression in SQL for each of the following queries.
1. Find the names and cities of residence of all employees who work for
First Bank Corporation. [2marks]
2. Find all employees in the database who live in the same cities as the
companies for which they work. [2marks]
3. Find all employees in the database who earn more than every
employee of Small Bank Corporation. For this query, assume that all
people work for at most one company. [2marks]
4. Assume that the companies may be located in several cities. Find all
companies located in every city in which Small Bank Corporation is
located. [2marks]
(8.0 Marks)
about:blank 3/6
11/8/24, 12:44 PM ESA - DEC 2023 - UE21CS351A (set- 2)
2.d. What are triggers [1 mark] and write a trigger statement for checking
student age before enrolling to course. If age is less than 18, he should
not be allowed to register to course else add him to registration table. [4
marks]
Following table data can help you in writing trigger:
Student
StudentID Name EmailID Age Phoneno
Course
CID CourseName Credits
Registration
StudentID CID DateOfRegistrationFeesPaid
(5.0 Marks)
about:blank 4/6
11/8/24, 12:44 PM ESA - DEC 2023 - UE21CS351A (set- 2)
(5.0 Marks)
(5.0 Marks)
about:blank 5/6
11/8/24, 12:44 PM ESA - DEC 2023 - UE21CS351A (set- 2)
4.b. consider student as collection with fields like name, srn, section,
semester, branch, sgpa, cgpa, phoneno, email.
Note: draw the query tree to explain the importance of the optimization.
(10.0 Marks)
about:blank 6/6
11/8/24, 12:44 PM ESA - DEC 2023 - UE21CS351A (set- 1)
1.b. Many database-system users are not computer trained and hence
developer hide all these complexity from the users through several layers
of data abstraction, in order to simplify the users’ interaction with the
system.
Explain the different levels of data abstraction in a Database system with
a neat diagram and (4 Marks)
Define the logical data independence and the physical data independence
in data abstraction. (2 Marks) (6.0 Marks)
1.c. Consider the CAR relation schema and identify the primary key and
candidate key. (2 Marks)
CAR(State, Reg#, SerialNo, Make, Model, Year)
In general, Explain briefly about differentiating the primary key and the
candidate key of a relational schema? (1 Mark) (3.0 Marks)
about:blank 1/8
11/8/24, 12:44 PM ESA - DEC 2023 - UE21CS351A (set- 1)
Note:
Chen notation
Indicate cardinality ratio as 1:1,1: N,N:1 and M:N
Participation constraint as total (double line) and partial participation
(Single line)
(10.0 Marks)
about:blank 2/8
11/8/24, 12:44 PM ESA - DEC 2023 - UE21CS351A (set- 1)
2.b.
1. What do you mean by views in SQL? Is the view table contents are
precomputed and stored? Illustrate views with an example (3 Marks)
2. Consider the following tables and write a SQL query to fetch the
customer names and their highest purchased amount of each
customer.(2 Marks)
(5.0 Marks)
about:blank 3/8
11/8/24, 12:44 PM ESA - DEC 2023 - UE21CS351A (set- 1)
2.d.
1. Explain the different modes of stored procedure parameters?(2
Marks)
2. Write a procedure ‘displaymarks’ to display the marks of student for a
specific srn(type ‘integer') that is passed to the procedure. Write the
commands to invoke the procedure, pass the parameter and fetch
the result of the procedure from the command line client of mysql? (
4 Marks)
(6.0 Marks)
about:blank 4/8
11/8/24, 12:44 PM ESA - DEC 2023 - UE21CS351A (set- 1)
3.a. What is the process to determine whether the given two sets of
Functional dependencies, say F and G are Equivalent? (1 Mark)
Consider the relation R(A,B,C,D) having two FD sets FD1 = {A->B, B->C,A-
>C} and FD2 = {A->B, B->C, A->D}. Determine whether FD1 and FD2 are
Equivalent in detailed list of steps. (4 Marks) (5.0 Marks)
3.b. Give the algorithm to find the minimal cover of a set of functional
dependencies and (2 Marks)
Find the minimal cover of the set of given functional dependencies: {A →
C, AB → C, C → DI, CD → I, EC → AB, EI → C} (4 Marks) (6.0 Marks)
about:blank 5/8
11/8/24, 12:44 PM ESA - DEC 2023 - UE21CS351A (set- 1)
3.c. Illustrate and explain the first normal form(1NF), general definition of
second normal form (2NF) and general definition of third normal
form(3NF) with an example for each of them. (2+3+3 Marks) (8.0 Marks)
3.d.
1. Differentiate serial and serializable schedules for a given set of
transactions. Briefly explain with two key points.(2 Marks)
2. Consider the below given schedule and check whether the given
schedule is conflict serializable by listing all the conflicting operations
and drawing the precedence graph.(4 Marks)
(6.0 Marks)
about:blank 6/8
11/8/24, 12:44 PM ESA - DEC 2023 - UE21CS351A (set- 1)
4. Remove all the 'Orders' in the ecommerce database for the customer
having the 'customer_id' as 5. (2 Marks)
(8.0 Marks)
4.b. Explain the neo4j data model and (3 Marks)
write the following queries using neo4j-cypher query language
1. create a node with label ‘Book’ and a set of properties such as title:
Database, edition: seven and publisher: pearson (2 Marks)
2. Update the title of the book from ‘Database’ to ‘Database system’ (2
Marks)
3. Remove the node with the label book if the title is ‘Database system’
(1 Mark)
(8.0 Marks)
4.c. Explain the steps to access mysql database from a python application
with a neat diagram. (5.0 Marks)
about:blank 8/8