CodingNic

Querying Data

Module Overview

Querying Data 5 min read

Module Overview

What You’ll Learn

  • Filter data
  • Sort query results
  • Limit returned rows
  • Search for matching values

💡 Why this module matters: Every SELECT so far has returned an entire table. Real questions are almost always narrower than that, “which orders shipped late,” “which products cost under $20,” this module is where SELECT becomes genuinely precise.

What’s Covered

  • WHERE, filtering which rows a query returns.
  • Comparison operators, AND, OR, and NOT, building filter conditions, simple and combined.
  • BETWEEN and IN, matching a range or a set of specific values.
  • LIKE and ILIKE, pattern-matching text, case-sensitive and case-insensitive.
  • IS NULL, checking for missing values, a comparison operator alone can’t do this.
  • ORDER BY, LIMIT, and OFFSET, sorting results and controlling how many rows come back.

Hands-On

By the end of this module, you’ll filter employee records, search products, sort customer lists, and retrieve top results, exactly the kind of precise querying real applications rely on constantly.

Next module adds calculation to the mix, PostgreSQL’s built-in functions for working with text, numbers, and dates directly inside a query.