Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
25 views

Sab Query of Dbms

The document provides instructions for a database management systems (DBMS) lab assignment involving students, courses, and registration data stored in tables. It includes: 1. Details of the COURSE, STUDENT, and REGISTER tables to be used, including sample data. 2. A prompt to verify the table contents. 3. Thirteen queries to write involving subqueries, joins, aggregations and outer joins to retrieve and summarize data from the tables in various ways such as obtaining student details and associated course details, finding expensive courses, aggregating fees by department, and more.

Uploaded by

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

Sab Query of Dbms

The document provides instructions for a database management systems (DBMS) lab assignment involving students, courses, and registration data stored in tables. It includes: 1. Details of the COURSE, STUDENT, and REGISTER tables to be used, including sample data. 2. A prompt to verify the table contents. 3. Thirteen queries to write involving subqueries, joins, aggregations and outer joins to retrieve and summarize data from the tables in various ways such as obtaining student details and associated course details, finding expensive courses, aggregating fees by department, and more.

Uploaded by

Akansha Uniyal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Lab assignment

(SUBQUERY, GROUPING, JOINS) SUBJECT: DBMS


1. Ensure that your login has following tables with proper constraints and data:-
COURSE TABLE
CourseCode CourseName CourseFees Department
101 MCA 80000 MCA
102 MBA 60000 MBA
103 Btech 75000 Engg
104 BCA 30000 MCA
105 BSc(IT) 25000 MCA
106 MSc(IT) 35000 MCA
107 BBA 22000 MBA

STUDENT TABLE
RollNo Name City
1 Amit Delhi
2 Sumit Goa
3 Shweta Gwaliar
4 Kumar Goa
5 Puneet Meerut
6 Bharat Gwaliar

REGISTER TABLE
RollNo CourseCode
2 101
4 103
5 101
3 105
1 103

2. See the contents of above table and commit data


“Please verify your output each time with above tables”

3. Write queries for the following:-


a) Show details of all students
b) Show details of all students who aren’t registered in any course
c) Show details of students who are registered in any course:
• Write Query Using Join
• Write Query Using Sub query
d) Details of all students along with course details in which they are registered, if any.
Include those students also which are not registered (Use Outer Join)
e) Display third highest fees
f) Number of students from each city
g) Details of students who are registered in most expensive course
h) Display highest course fees
i) Display second highest course fees
j) Display total sum of all course fees
k) Display department wise total fees of all courses. Show both department name and
total fees
l) Display department wise total fees of all those departments whose total department
fees is greater than Rs. 80000/- (How many rows are displayed?)
m) Display department wise total fees of only those courses having fees greater than Rs.
30000/- ( How many rows are selected?)

You might also like