SQL Quiz & Exercises π¶
Mentor's Note: Reading is good, but doing is better. Try to solve these problems without looking at the reference hub. If you can solve all 5, you are ready for your college exams! π‘
π Part 1: Multiple Choice¶
Q1. Which clause is used to filter groups after they have been aggregated?¶
- A) WHERE
- B) ORDER BY
- C) HAVING
- D) DISTINCT
Q2. What is the result of 10 + NULL in SQL?¶
- A) 10
- B) 0
- C) Error
- D) NULL
π» Part 2: Practical Challenges¶
Challenge 1: The High Rollers π°¶
Problem: Find all employees who earn more than βΉ60,000 and sort them by name alphabetically.
Challenge 2: The Missing Email π§¶
Problem: Count how many students have not provided an email address.
Challenge 3: The Multi-Table Match πΈοΈ¶
Problem: Show the emp_name and the dept_name for every employee using an INNER JOIN.
View Solution
π Self-Assessment¶
- 0-2 Correct: Go back to Foundations. πΆ
- 3-4 Correct: Good progress! Review Joins. π§
- 5 Correct: SQL Master! Move to PL/SQL. π
π‘ Pro Tip: "Consistency is what transforms average into excellence. Practice one query every day!"