
SQL Subqueries and Joins Quiz
Quiz
•
Information Technology (IT)
•
University
•
Practice Problem
•
Medium
ARLENE QUICAY
Used 7+ times
FREE Resource
Enhance your content in a minute
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which of the following queries best finds students who are taking the same course as 'Alice' using a subquery?
SELECT StudentName FROM Students WHERE CourseID IN (SELECT CourseID FROM Students WHERE StudentName = 'Alice');
SELECT StudentName FROM Students s JOIN Courses c ON s.CourseID = c.CourseID WHERE c.CourseName = 'Alice';
SELECT StudentName FROM Students WHERE StudentName = 'Alice';
SELECT StudentName FROM Students WHERE CourseID = ALL (SELECT CourseID FROM Courses WHERE CourseName = 'Alice');
2.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
You are tasked to find instructors not assigned to any course. Which type of SQL approach is most appropriate?
Inner Join
LEFT JOIN with WHERE CourseID IS NOT NULL
Subquery using NOT IN
Correlated Subquery inside JOIN
3.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Why might a subquery be preferred over a join in Task 1 (finding students enrolled in 'Database Systems')?
It simplifies the query by hiding the relationship in a nested form
It uses fewer keywords, making the SQL script shorter to write and read
Because it clearly separates the filtering condition from the main query
Because JOINs do not work with multiple tables
4.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which query correctly lists students taking courses with no assigned instructor using a JOIN?
SELECT StudentName FROM Students JOIN Courses ON Students.CourseID = Courses.CourseID WHERE Courses.InstructorID IS NULL;
SELECT StudentName FROM Students JOIN Instructors ON Students.CourseID = Instructors.InstructorID;
SELECT StudentName FROM Students WHERE InstructorID IS NULL;
SELECT StudentName FROM Students JOIN Courses ON Courses.InstructorID IS NOT NULL;
5.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which JOIN ensures that all students are listed even if their course has no instructor assigned?
INNER JOIN between Students and Instructors
LEFT JOIN between Students → Courses → Instructors
RIGHT JOIN between Instructors and Courses
CROSS JOIN between Students and Courses
6.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which of the following best explains when to prefer an INNER JOIN over a subquery?
When filtering using a single-column comparison
When you need to filter rows that have no related values
When combining data from multiple tables for result display
When avoiding Cartesian products
7.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which query correctly returns instructors who are not assigned to any course using a LEFT OUTER JOIN?
SELECT i.InstructorName FROM Instructors i LEFT JOIN Courses c ON i.InstructorID = c.InstructorID WHERE c.CourseID IS NULL;
SELECT i.InstructorName FROM Instructors i LEFT JOIN Courses c ON i.InstructorID = c.InstructorID WHERE i.InstructorID IS NULL;
SELECT i.InstructorName FROM Instructors i LEFT JOIN Courses c ON c.InstructorID = i.InstructorID WHERE c.InstructorID IS NOT NULL;
SELECT i.InstructorName FROM Instructors i JOIN Courses c ON i.InstructorID = c.InstructorID WHERE c.CourseID IS NULL;
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
usabilidad - htm - css
Quiz
•
University
20 questions
Basic CSS Quiz
Quiz
•
9th Grade - University
15 questions
Quiz Pertemuan 12
Quiz
•
University
10 questions
Quiz 3 Supertype Subtype & Optionality Transferability
Quiz
•
University
15 questions
Chapter 3 : SQL Command
Quiz
•
University
10 questions
AverageRound
Quiz
•
University
20 questions
6E UAS LIterasi Big Data
Quiz
•
University
10 questions
Access Control (Authorise vs Authenticate)
Quiz
•
University
Popular Resources on Wayground
7 questions
History of Valentine's Day
Interactive video
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
15 questions
Valentine's Day Trivia
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
Discover more resources for Information Technology (IT)
18 questions
Valentines Day Trivia
Quiz
•
3rd Grade - University
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
23 questions
Subject Verb Agreement
Quiz
•
9th Grade - University
5 questions
What is Presidents' Day?
Interactive video
•
10th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
20 questions
Mardi Gras History
Quiz
•
6th Grade - University
10 questions
The Roaring 20's Crash Course US History
Interactive video
•
11th Grade - University
17 questions
Review9_TEACHER
Quiz
•
University
