DBMS Assignment - 2
DBMS Assignment - 2
02 (UNIT-II)
Course Outcome-2, Session 2023-24
SUB: Data Base Management Systems (KCS-501)
Q.1. Show your understanding of their essential features of the following terms in detail (At
least one page for each term):
a) Relational Algebra
b) Tuple Relational Calculus
c) Structured Query Language
Q.4 Two tables R and S are given; Find the NATURAL JOIN of R and S.
R S
B C
A B NULL 123
1 1 NULL 234
2 1 1 345
3 NULL 2 456
4 2
Q. 6 Consider the following MAILORDER relational schema describing the data for a mail
order company.
PARTS(Pno, Pname, Qoh, Price, Olevel)
CUSTOMERS(Cno, Cname, Street, Zip, Phone)
EMPLOYEES(Eno, Ename, Zip, Hdate)
ZIP_CODES(Zip, City)
ORDERS(Ono, Cno, Eno, Received, Shipped)
ODETAILS(Ono, Pno, Qty)Qoh stands for quantity on hand: the other attribute names are
self-explanatory. Specify
and execute the following queries using the Relational Algebra interpreter on the
MAILORDER database schema.
a) Retrieve the names of parts that cost less than $20.00.
b) Retrieve the names and cities of employees who have taken orders for parts costing more
than $50.00.
c) Retrieve the pairs of customer number values of customers who live in the same ZIP
Code.
d) Retrieve the names of customers who have ordered parts from employees living in
Wichita.
e) Retrieve the names of customers who have ordered parts costing less than $20.00.
f) Retrieve the names of customers who have not placed an order.
g) Retrieve the names of customers who have placed exactly two orders.
Q.7 Consider the following GRADEBOOK relational schema describing the data for a grade
book of a particular instructor. (Note: The attributes A, B, C, and D of COURSES store
grade cutoffs.)
CATALOG(Cno, Ctitle)
STUDENTS(Sid, Fname, Lname, Minit)
COURSES(Term, Sec_no, Cno, A, B, C, D)
ENROLLS(Sid, Term, Sec_no)
Specify and execute the following queries using the Relational Algebra interpreter on
the GRADEBOOK database schema.
a) Retrieve the names of students enrolled in the Automata class during the fall 2009
term.
b) Retrieve the Sid values of students who have enrolled in CS226 and CS227.
c) Retrieve the Sid values of students who have enrolled in CS226 or CS227.
d) Retrieve the names of students who have not enrolled in any class.
e) Retrieve the names of students who have enrolled in all courses in the CATALOG
table
Q.8 Explain the Codd’s rules for RDBMS.
Q.17. What are Triggers? How are they different from the assertions?
a) Retrieve Sname of the student who got ‘A’ grade at least one course taught by
Lazart
b) Retrieve Sname of students who got ‘A’ grade in all the courses.
Q19. Consider the following scheme for PROJECT database:
Project (Project_No, Project_Name, Project_Manager)
Employee( Employee_No, Employeee_Name)
Assigned_To ( Project_No, Employee_No)
(i) Write SQL-DDL statement for implementation of PROJECT database. The SQL
statement should clearly indicate the primary key and Foreign Keys.
(ii) Write following queries in relational algebra and SQL:
Get the detail of employees working on both projects ‘P1’and ‘P2’
List the name of employees working on project ‘P1’but not on project ‘P2’.
Delete the record of employee whose Employee number is É1’.
List the name of employees who are working on a project for which É1’is the project
manager.