0% found this document useful (0 votes)
18 views5 pages

PES University, Bengaluru

Qpp

Uploaded by

abhinavraghav991
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views5 pages

PES University, Bengaluru

Qpp

Uploaded by

abhinavraghav991
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

PES University, Bengaluru

(Established under Karnataka Act 16 of 2013)

END SEMESTER ASSESSMENT (ESA) - JULY - 2023

UE20CS301. - Database Management System

Total Marks : 100.0

1.a. Database Application to be developed for a “RU-Hungry” - food ordering


service, like Swiggy or Zomato. Customer can register with basic credentials, order
food, and give reviews from the application. Customers can register with multiple
addresses (office and home address). Each restaurant should register with their
name, address, year of establishment, owner, cuisine(or cuisines) and no_of_years
since its establistment. Should accommodate multiple owners if any.Each
restaurant will have a unique menu and register the menu information like
item_name, description, category, price and quantity(if applicable). Application
should have provision for customer to select the item and add to the cart, as each
customer has a unique cart. The order is placed based on the contents of the cart.
The order information like ordered, ETA, status, time has to viewed by registered
delivery agent who picks and delivers the order to specific customer. Each delivery
agent will have name, id, multiple phone numbers. When a customer, restaurant
or delivery agent sign up for the app, a wallet is automatically created for them, to
which they can add money from external sources. (7.0 Marks)

1.b. Enlist the main characteristics of database approach (4.0 Marks)

1.c. Elucidate three-schema architecture with a neat diagram. Explain different


levels involved in the architecture and what are its advantages. (5.0 Marks)
1.d. What information is represented by participation constraint and cardinality
ratio in ER diagram? Illustrate with relevant examples (4.0 Marks)

2.a. Describe the steps in a line or two to convert Entity Relationship diagram into
Relational Mapping (7.0 Marks)

2.b. Consider the following relations:


Person(name, age, gender)
Frequents(name, pizzeria)
Eats(name, pizza)
Serves(pizzeria, pizza, price)
Specify the following queries in Relation Algebra:
a: Find all pizzerias frequented by at least one person under the age of 18
b: Find the names of all females who eat either mushroom or pepperoni pizza
(or both).
c: Find the names of all females who eat both mushroom and pepperoni
pizza.
d:Find all pizzerias that serve at least one pizza that Amy eats for less than
$10.00 (8.0 Marks)

2.c. Briefly discuss different types of Constraints in Relational Model (5.0 Marks)
3.a. Consider the following relation:
Employee(Eid, Ename, Salary, dno)
Department(dno,dname)

Note: dno is a foreign key in Employee referring to Department’s primary key

Specify the SQL statements for the following:


a: Add a column “deptstartdate” into Department which can take date values and
with default value ’21-12-2023’
b: Retrieve the name and address of all the Employees who work for the ‘Design’
Department.
c: Find the number of employees working for each department.
d: Delete all employees who are working for “Engineering” department
e: Find the max salary of the employees working for department with more than 2
employees (10.0 Marks)

3.b. i) A table T1 in a relation database has following rows and columns.


Roll number Marks.
1 10
2 20
3 30
4 NULL

On executing the below two sql statements in sequence, what will be the output of
select statement.
Update T1 set marks =marks + 5 ; select avg(marks) from T1 ;

ii) Consider the following table student. What will be the output of these SQL
queries:
a: Select count(*) from student;
b: Select count(marks) from student;
Student table:
ID Sname Marks
1 Uma 10
2 Dheeraj 20
3 Rio Null
4 Rio Null
(4.0 Marks)

3.c. What are Virtual tables or View in SQL? Specify different ways to handle view
materialization. (6.0 Marks)
4.a. Define the following:
1) Candidate Key
2) Non Prime attribute
3) Second normal form
4) Super key
5) Spurious Tuples (5.0 Marks)

4.b. Given below are two sets of FDs F1 and F2 for a relation R(A,B,C,D,E). Are they
equivalent?
F1 = A->B, AB->C, D->AC, D->E
F2 = A->BC, D->AE (8.0 Marks)

4.c. For the relation R =(P, Q, R, S) and set of following functional dependency
F = {R→S, R→P, Q→R}
i. Identify all the candidate keys of R
ii. Which normal form is R in?
Decompose R into a set of BCNF relations. (7.0 Marks)

5.a. Give the SQL commands for the following


1) To provide all permission to user ‘john’ for the table employee
2) Grant insert privilege to all users on table Department
3) To revoke insert privilege from user john on table department
4) To eliminate all privileges from user ‘john’ on the view works_on
5) Command to undo the instructions (5.0 Marks)
5.b. How are the deadlocks identified in concurrent transactions? What are the two
schemes for preventing deadlocks? (5.0 Marks)

5.c. Give mongodb commands for the following:


a) Command to create a collection named “mydb”
b) Command to list all the collections in the database
c) Command to display the first document in the collection “DBMS”
d) Command to display skip first five instances of the collection DBMS and
display the remaining instances.
e) Command to delete a the collection “DBMS” (5.0 Marks)

5.d. What are ACID properties in transactions? Specify the need for ACID
properties. (5.0 Marks)

You might also like