0% found this document useful (0 votes)
33 views2 pages

SQL Query Tasks for Class Data

The document discusses a lab assignment on SQL queries. It provides tables for Teachers and Classes and tasks students to write queries to retrieve specific records and fields based on conditions. The tasks include displaying classes within a time range, retrieving teacher details by name, finding class days by course and time, listing courses by venue, and selecting unique course codes.

Uploaded by

malikjavaid093
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)
33 views2 pages

SQL Query Tasks for Class Data

The document discusses a lab assignment on SQL queries. It provides tables for Teachers and Classes and tasks students to write queries to retrieve specific records and fields based on conditions. The tasks include displaying classes within a time range, retrieving teacher details by name, finding class days by course and time, listing courses by venue, and selecting unique course codes.

Uploaded by

malikjavaid093
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/ 2

Lab 11

SQL Queries

Consider the following tables and perform the given Tasks.


Teacher:
TeacherID Name Office Phone Email
T001 Dr. Najma Waheed F001 9125 najma@uni.edu.pk
T002 Dr. Nouman F003 NULL nayyer@uni.edu.pk
Masood
T003 Dr. Farhana Khan F002 9222 farhana@uni.edu.pk
T004 Dr. Tayyaba Ali F005 9325 tayyaba@uni.edu.pk
T005 Mr. Nouman F006 9145 nouman@uni.edu.pk
Ahmad
T006 Mr. Waqass F004 NULL waqas@uni.edu.pk
Raheem

Class:
ClassID CourseCode DayofWeek TimeStart TimeEnd Venue TeacherID
A001 CS403 Monday 09:00 AM 10:00 AM A Block T003
B002 CS301 Tuesday 09:00 AM 10:00 AM B Block T005
A001 CS304 Tuesday 14:00 PM 15:00 PM A Block T002
C003 CS201 Monday 10:30 AM 12:00 PM C Block T006
C003 CS301 Friday 12:00 PM 13:00 PM C Block T005
B005 CS403 Friday 12:30 PM 14:00 PM B Block T003

Tasks:
1. Display all the records of the class whose start time is between 09:00 AM and 12:00 PM.
2. Retrieve all details of teachers whose names starts with Dr.
3. Display days of weeks in which classes of CS403 are scheduled at 09:00 AM.
4. Display the Subjects which are taught in B Block.
5. Select the unique course code from Class table (avoid duplicate values).
Solution:
1:

Select *
From Class
Where StartTime Between '09:00' and '12:00'

2:
Select * from Teacher
Where Name Like 'Dr.%'

3:
Select DayofWeek
From Class
Where CourseCode='CS403' AND StartTime='09:00:00'

4:
Select CourseCode
From Class
Where Venue='B Block'

5:
Select distinct CourseCode
From Class

Mechanism to Conduct Lab:


Lab will be conducted via Google Meet / Zoom.

You might also like