0% found this document useful (0 votes)
45 views3 pages

(CS-244) Assignment-04 Joins

This document provides instructions for a database systems lab assignment on SQL joins. Students are asked to complete 10 queries on the "Student" database, importing data from the "Student.txt" file. The queries include listing course details with program information, counting courses by program, filtering program results, displaying programs and departments with counts, and queries involving teacher, course, and student tables. Students are instructed to submit their assignment responses via Google Classroom by the given deadline.

Uploaded by

Hina jamil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views3 pages

(CS-244) Assignment-04 Joins

This document provides instructions for a database systems lab assignment on SQL joins. Students are asked to complete 10 queries on the "Student" database, importing data from the "Student.txt" file. The queries include listing course details with program information, counting courses by program, filtering program results, displaying programs and departments with counts, and queries involving teacher, course, and student tables. Students are instructed to submit their assignment responses via Google Classroom by the given deadline.

Uploaded by

Hina jamil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

BS-SE / BS-CS Program CS-244/128 GIFT University Gujranwala

Course: Database Systems (Lab) (Spring 2021)


Resource Person: Vaneeza Shahid LAB ASSIGNMENT-
04

Name: ________________________

Roll No: _______________________

Topic: SQL Joins


Total Points: 20 Points
Submission Due: 11-08-2021

Instructions: Please Read Carefully!


• This is an individual assignment. Everyone is expected to complete the given assignment on their
own, without seeking any help from any website or any other individual. There will be strict
penalties for any work found copied from any source and the university policy on plagiarism will be
strictly enforced.
• This assignment will be labelled as Assignment No. 4 on your times portal as well as Google
Classroom.
• There will be a Lab test assessment(s) in the following week based on this assignment.
Assignment Submission Method:
• You are expected to submit this assignment as:
a. Turn the same Word document with solution on your Google Classroom.
• Assignment is to be submitted via Google Classroom within the stated deadline above.
a. Make sure that the email has been successfully delivered and no delivery failure message is
received by you.
• Any assignment submission not following the above directions will not be accepted!
• Late submissions carry a 20% penalty!

Page 1 of 3
BS-SE / BS-CS Program CS-244 GIFT University Gujranwala

Instructions:
1. Create database on phpMyAdmin with the name “Student”.
2. Import text file “Student.txt” and here you go all the tables and data will be imported.
3. Read the queries carefully, perform the query on phpMyAdmin and screen the result.
4. Copy and paste the queries and add screenshot of the result of all the queries.

SQL JOINS Queries


1.List all the course id, course titles with their program id, program name and
credit hours. Order the result by program id.
2.Using the output of query#1 now count the no of courses offered in each program
and display all the programs excluding those that contain CS in their program
name.
3.Generate a query that list all the programs that are not offered by Accounting
and Finance and Business Department. Order the result by total credit hours in
descending order.
4.Write a query that displays the number of programs offered in each year by each
department. Your output must contain department id, department name, year as
well as number of programs offered. Use proper column aliasing to display the
output.
5.Using the output of query#4, now display only those rows whose count value is
exactly one.
6.List all the teacher id, teacher names, salary and their qualifications along with
department name of only MPhil teachers;
7.Write an SQL statement that displays the teacher id, teacher name, salary,
qualification as well as department name of all those teachers whose salary is
less than Saad Tanveer. Sort the output with respect to Salaries in Descending
Order.
8.Write a query that displays the course id, course title and no of students enrolled
in that course. Sort your output in descending order. Use proper column aliasing
to display your output.
9.Due to Lockdown University went online and in meantime Hassan has joined the
University. After Lockdown University started its In-Campus classes but Hassan
does not know about his Class fellows. He came up with an idea to search for all
the courses in which he is enrolled as well as all the students who are also
enrolled in those courses to find out his class fellow. Now assist Hassan by
writing an SQL query which will print all the courses in which Hassan is enrolled
as well as his class fellows who are also enrolled in those courses. Note your final
output should display only the class fellows of Hassan.

Page 2 of 3
BS-SE / BS-CS Program CS-244 GIFT University Gujranwala

10. The department wants to check the workload of all the teachers by checking
the number of courses taught by each teacher. Write an SQL statement that
displays the teacher id, teacher name and no the courses taught by that teacher.
Display only those teachers that are teaching exactly one course.

**END OF ASSIGNMENT**

Page 3 of 3

You might also like