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

Assignment 2

The document contains questions about relational algebra and SQL queries on relations about students, books, and book issues. It also contains questions about creating tables with constraints and writing a cursor to display employee details from an EMP table.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Assignment 2

The document contains questions about relational algebra and SQL queries on relations about students, books, and book issues. It also contains questions about creating tables with constraints and writing a cursor to display employee details from an EMP table.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

DBMS UNIT 2

Assignment -2

Q. 1 Consider the following three relations:

Student (Roll, Name, Course, DateOf Reg)

Book (Bcode, Bname, Publisher, Author, Price)

Issue (Roll, Bcode, DateOfIssue, DateOfRet)

Now write queries for the following in relational algebra as well as in SQL:

1. Find the names of books issued to ‘Manoj’.

2. Find the price of the books issued to roll no. 20

3. Find the names of students with their course who issued books on 23rd February 2016.

4. Display the names and publisher of books issued to MCA students.

5. Display the names of books issued to Sonali and Monika both.

Q. 2 solve the following queries by creating tables with proper constraints.

STUDENT (Membership_No. Name, Course)

BOOK (Book_ID, Category, Title, Author, Price, Status)

BOOK_STATUS (Book_ID, Membership_No., Issue_Date, Return_Date, Fine_Charger,


Fine_Paid)

i) Display the books under the category “Networking” currently available in library.
ii) Find the member who has paid maximum fine.
iii) Display all book details which are returned today.

Q.3 Write an explicit cursor which will display employee number and name of all employees
make use of the EMP table.

EMP (Empno, Ename, Job, Mgr, Hiredate, Sal, Comm, Deptno)

You might also like