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

Join Queries

abc

Uploaded by

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

Join Queries

abc

Uploaded by

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

Basic Joins

1. List All Students and Their Departments

o Query the student table to list all students with their corresponding department names.

2. Find Courses and Their Instructors

o Retrieve all courses and the names of the instructors teaching them.

3. Get All Sections for a Given Course

o Find all sections for the course with course code 'CS-101' and show the term, year,
building, and room number.

4. List All Instructors and Their Teaching Sections

o Display each instructor's ID, name, and the course section they are teaching.

5. Find Students Enrolled in a Specific Course

o List all students enrolled in the course 'BIO-101', including their IDs and names.

Intermediate Joins

6. Find Students and Their Advisors

o Retrieve all students with their advisor's ID and name.

7. Get Courses with Prerequisites

o List all courses that have prerequisites, including the course code, course name, and the
prerequisite course code.

8. List Departments and Their Courses

o Show each department with the courses it offers, including department name and
course title.

9. Find Courses Taught by a Specific Instructor

o Find all courses taught by the instructor with ID '83821', including course codes and
titles.

10. Show Students with Their Grades in a Specific Course

o List students and their grades for the course 'CS-319'.

Advanced Joins

11. List Students Who Took All Courses in a Department

o Find students who have taken all courses offered by the Comp. Sci. department.

12. Find Instructors Teaching Multiple Courses


o List instructors who teach more than one course, including their IDs and the count of
courses they teach.

13. Find Students with Advisors in a Specific Department

o List students whose advisors are from the Comp. Sci. department, including student IDs
and advisor names.

14. List Departments with No Courses Offered

o Find departments that do not offer any courses, including department names.

15. Find the Average Grade of Students in Each Course

o Calculate the average grade for each course, including course codes, titles, and average
grades.

Expert Joins

16. Find the Most Popular Time Slot for Each Course

o Determine which time slot (e.g., 'A', 'B', 'C', etc.) is most frequently assigned to sections
of each course.

17. List Students with the Highest Number of Credits Taken in Each Department

o Find the student who has taken the highest number of credits in each department.

18. Find Courses That Were Not Taught in a Specific Semester

o List courses that were not taught in the Spring 2018 semester.

19. Find the Departments with the Most Number of Courses Taught

o Count the number of courses taught by each department and list them in descending
order.

20. Show the Relationship Between Instructors, Students, and Courses

o Display the relationship between instructors, students, and the courses they are enrolled
in, including the course code, student ID, student name, instructor ID, and instructor
name.

You might also like