Lesson 1, Topic 1
In Progress

Lesson 2.4 – Create Simple Queries Using SELECT, FROM, DISTINCT, and WHERE Clauses

Lesson 2.4 Teacher Edition โ€“ Create Simple Queries Using SELECT, FROM, DISTINCT, and WHERE Clauses
Unit 2 ยท Lesson 2.4 ยท Teacher Edition

Create Simple Queries Using SELECT, FROM, DISTINCT, and WHERE Clauses

Teacher's companion guide for Lesson 2.4: pacing, differentiation, checks for understanding, and quiz items.

SQL Coding Specialist โ€” 60-Hour Course ~90 Minutes Beginner

Learning Objectives

By the end of this lesson, you will be able to:

  • Construct basic SQL queries to retrieve data from a single table using the SELECT and FROM clauses.
  • Use the WHERE clause to filter query results based on conditions (e.g., matching a specific value or range).
  • Apply the DISTINCT keyword to eliminate duplicate values in query results.
  • Understand the general syntax order of a query and how clauses like SELECT, FROM, WHERE, and DISTINCT interact.
  • Practice writing several example queries against a sample schema (e.g., the SchoolHub Students table) to retrieve targeted information.

โฑ๏ธ Pacing & Materials

Suggested Pacing โ€” ~90 minutes

  • Warm-up (5 min): Open with the lesson's real-world analogy. Ask 1โ€“2 students to restate it in their own words.
  • Direct instruction (20 min): Walk through the Concept Explanation. Pause every few minutes for a quick check-for-understanding.
  • Guided practice (15 min): Demonstrate a worked example, then have students attempt one with a partner.
  • Independent / lab work (35 min): Students complete the Hands-On Practice and Coding Lab activities. Circulate to support.
  • Wrap-up / exit ticket (10 min): Quick review of vocabulary plus an exit ticket question.
  • Reflection (5 min): Preview the next lesson and assign any homework.

Materials needed

  • Knowledge Pillars Coding Lab (or equivalent SQL sandbox) on every student's device.
  • Whiteboard or shared screen for live SQL demos.
  • Printed vocabulary handout (optional but recommended for ELL / reading-support students).
  • The SchoolHub sample schema from Unit 1.

๐ŸŽ“ Differentiation Strategies

๐ŸŒฑ Support

Provide a printed reference card of the lesson's keywords and syntax. Pair struggling students with a confident partner for the Coding Lab and break the activity into one micro-step at a time.

๐Ÿš€ Stretch

Challenge advanced students to extend the lab task โ€” write a more complex query, add an extra column, or research a related advanced feature and present it to the class.

๐Ÿ‘๏ธ Visual learners

Sketch the query result as a table on the board before running it. Predict the shape, then compare to the actual output.

โœ‹ Kinesthetic

Have students physically arrange index cards representing rows and columns to model what each clause does to the data.

๐Ÿ‘ฏ Pair programming

Use a driver/navigator model: one student types, the other dictates the query. Swap every 5 minutes.

๐Ÿ“– ELL strategy

Pre-teach the lesson's English vocabulary. Provide a glossary in students' first language where possible. Use lots of visuals.

โœ… Check for Understanding

Sprinkle these throughout the lesson โ€” not just at the end:

  • "In one sentence, what does this lesson's main keyword do?"
  • "What's an example from SchoolHub where you'd use this?"
  • "What would happen if you forgot the semicolon at the end of this query?"
  • "If you change the WHERE condition, what changes in the output? Predict before running."
  • Exit ticket: Have students write the simplest query they can think of that uses the concept introduced today.

๐ŸŒ Real-World Connection

Every consumer app โ€” Spotify, Instagram, Amazon, Netflix, the school grade portal โ€” runs SQL queries like the ones in this lesson, just at a much larger scale. Career connections to highlight:

  • Data analyst โ€” writes SQL daily to answer business questions.
  • Backend developer โ€” builds apps that issue SQL on every user request.
  • Database administrator โ€” designs and maintains the systems SQL runs on.
  • Business intelligence specialist โ€” turns SQL results into dashboards.
  • Data scientist โ€” uses SQL as the first step before machine learning.

SQL is one of the most durable tech skills on the market โ€” a query you write today will still work in ten years.

๐ŸŒŸ Extension Activities

  • Schema scavenger hunt: Have students pick an app they use daily and list at least three SQL queries that app probably runs.
  • Build the test cases: Ask students to invent two "tricky" data rows that should make the lesson's query behave unexpectedly, then run it and explain the result.
  • Pair-and-share: Each student writes one query, swaps with a partner, and tries to predict the output before running it.
  • Cross-unit link: Tie this lesson back to the SchoolHub schema from Unit 1 โ€” which tables are involved, and which earlier concepts (PK, FK, normalization) are at play?

๐Ÿงฐ Teacher Notes & Wrap-Up

Common stumbling blocks to watch for

  • Students using smart-quotes (' ') instead of straight quotes (' ') โ€” fix at the editor level early.
  • Missing semicolons at the end of statements.
  • Confusing AND with OR in compound WHERE clauses.
  • Spelling SQL keywords with mixed case where syntax matters (it usually doesn't, but it can confuse students).
  • Skipping the planning step and trying to type before sketching the result on paper.
๐Ÿ“Œ Bridge to next lesson: Wrap up by previewing how the next lesson builds on what students learned today. Give one concrete example of how the next concept extends or refines this one.

๐Ÿ“ Quiz Item Bank

Five quick-check items aligned to this lesson. Use them as a formative check, exit ticket, or short homework.

Q1. State, in your own words, what Create Simple Queries Using SELECT, FROM, DISTINCT, and WHERE Clauses accomplishes in SQL.

Look for: a clear, one-sentence explanation tied to a real example.

Q2. Write the simplest valid SQL statement that uses today's keyword.

Look for: correct syntax, proper terminator, sensible target table.

Q3. Given a small sample table, predict the output of a query that uses this lesson's concept.

Look for: reasoning about each clause in turn, not guessing.

Q4. Identify the bug in this query: SELECT * Students;

Answer: missing FROM โ€” should be SELECT * FROM Students;.

Q5. Connect this lesson to one earlier concept. How does today's skill build on what you already know?

Look for: reference to PK/FK, normalization, or previous SELECT mechanics.