0% found this document useful (0 votes)
163 views

DBMS Assignment - 2

The document contains an assignment with questions on relational database concepts. It asks the student to define relational algebra, tuple relational calculus, SQL data types, and constraints. It provides sample tables and asks the student to write queries in relational algebra and SQL to retrieve data from the tables based on certain conditions. It also asks questions about relational database management system properties, referential integrity, domain constraints, differences between SQL and relational calculus, views, triggers and more.

Uploaded by

SHIVAM
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
163 views

DBMS Assignment - 2

The document contains an assignment with questions on relational database concepts. It asks the student to define relational algebra, tuple relational calculus, SQL data types, and constraints. It provides sample tables and asks the student to write queries in relational algebra and SQL to retrieve data from the tables based on certain conditions. It also asks questions about relational database management system properties, referential integrity, domain constraints, differences between SQL and relational calculus, views, triggers and more.

Uploaded by

SHIVAM
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

ASSIGNMENT NO.

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.2 Describe the different data types of SQL.

Q.3 How constraints are specified in SQL?

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.5 STUDENT (Sid, Sname, DoB),

COURSE (Cid, Cname, Faculty),


GRADES (Sid, Cid, grade)
Using the above data write down the Relational Algebra as well as SQL query of the
Following points given below.
a) Retrieve Sname of the student who got ‘A’ grade at least one course taught by Naveen.
b) Retrieve Sname of students who got ‘A’ grade in all the courses.
c) Retrieve Sname of students who got ‘A’ grade in all the courses taught by Naveen.
d) Retrieve the Sname of all the students who are enrolled in exactly 2 courses.
e) Retrieve the name of students who are not enrolled in any course taught by Naveen

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.9 Define RDBMS and also its properties.

Q.10 What do you mean by Referential Integrity?

Q.11 Explain domain constraints with an example.


Q.12 How does the relational calculus differ from relational algebra and how they are similar?
Q.13 How many types of relational calculus are there? Explain them in brief with the help of
suitable example.
Q.14 Define join and its types in details.
Q.15 What are the main difference between SQL and PL/SQL?
Q.16 What are views? How is view defined?

Q.17. What are Triggers? How are they different from the assertions?

Q.18 STUDENT (Sid, Sname, DoB),

COURSE (Cid, Cname, Faculty),

GRADES (Sid, Cid, grade)


Using the above data write down the SQL query of the questions given below.

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.

You might also like