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

Practical Sheet 5

This document provides instructions for an exercise on SQL subqueries and set theoretic functions. It includes 14 tasks to complete involving creating relations, inserting data, and writing SQL queries to retrieve and manipulate data from the relations. The tasks include finding student information based on application details, comparing data, aggregating data, and deleting records. Students are instructed to suffix their names and registration numbers when creating new tables.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views

Practical Sheet 5

This document provides instructions for an exercise on SQL subqueries and set theoretic functions. It includes 14 tasks to complete involving creating relations, inserting data, and writing SQL queries to retrieve and manipulate data from the relations. The tasks include finding student information based on application details, comparing data, aggregating data, and deleting records. Students are instructed to suffix their names and registration numbers when creating new tables.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

EXERCISE 5: SQL subqueries & set theoretic functions

Faculty Name: Dr. Abishi Chowdhury

Lab Slot: L15+L16

Class Number: CH2022235002536


Subject: Database System Lab (BCSE302P)

Date: 08/02/2023
Due Date for Submission: 9/02/2023

1. Create the following relations:


Student (sID: int, sName: varchar2(10), CGPA: int, city: varchar2(15),
phone_number: int)
Apply (sID: int, cName: varchar2(20), stream: varchar2(10))
College(cName: varchar2(20), state: varchar2(15))

Write SQL queries for the following:


2. Insert 10 tuples in each relation.
3. Find IDs and names of students who have applied in CSE stream at some
college.
4. Find the name of student with their CGPA and Sid whose CGPA not equal
to CGPA of Jhon.
5. Find college where students having their names started with S have applied.
6. Find IDs of student and major who applied in any of major Amy had
applied to. But exclude Amy sID from the list.
7. Find sID of student who applied to more or same number of college where
Jay has applied.
8. Find details of Students who applied to stream CSE but not applied to
stream ECE.
9. Find all the colleges such that some other colleges are in the same state.
10. Find name of student having lowest CGPA.
11. Find sID, sName, city of all students NOT from lowest CGPA,
12. Find sID of students who have not applied to DAV college.
13. Find the names of students who applied to all the colleges where sID 12 has applied.
14. Delete applications that are filed to state ‘Boston’.
NOTE: While creating any new table suffix your first name
along with last two digits of your registration number.
Eg: STUDENT_Abishi94

You might also like