Loading topic
SELECT ... WHERE query and use comparison operators, AND, and OR. You don't need to know IN, BETWEEN, or NULL handling yet. Later chapters cover those. Escaping, case sensitivity, negation, and indexes get their own chapters, so this one only po6 min read% and _ as ordinary text. It assumes you can write a basic SELECT ... WHERE query and that you know how LIKE uses the % and _ wildcards from the previous chapter. You only need basic string literals and comparison operators beyond that6 min readLIKE 'a%' matches Alice depends on the database, the column's collation, and sometimes a setting. This chapter explains why the same query can return different rows on different systems. It also shows how to write a case-insensitive match that behaves the same everywhere, and what that c6 min readSELECT, filter with comparison operators (=, <, >), and combine conditions with AND and OR. It covers IN with a literal list of values. Subqueries, NOT IN and NULL behavior are covered in later chapters, so this chapter only previews them.5 min readSELECT with a WHERE clause, you know what IN does with a literal list of values, and you have seen AND, OR, and NULL before. It covers how IN works when the list comes from another query, where this form is useful, and where it goes wrong.7 min readBETWEEN tests whether a value falls inside a range, where its edges sit, and what goes wrong at those edges. It assumes you can write a basic SELECT, know what tables, rows, and columns are, and can use comparison operators (=, <, >=) and AND/OR in a WHERE cla7 min readSELECT, use comparison operators and AND, and know that BETWEEN includes both endpoints. The main point is that BETWEEN fits whole numbers well but often misses rows when the column holds a time of 5 min readSELECT ... WHERE query, use comparison operators such as =, < and >, and combine conditions with AND and OR. It explains how NULL changes the result of the predicates covered in this tutorial: LIKE, IN and BETWEEN.5 min readSELECT ... WHERE query, know IN with a list and with a subquery, and have met NULL as "unknown" in SQL. It explains one of the most common silent bugs in SQL filtering: a NOT IN that returns zero rows even though matching rows clearly exist.6 min readLIKE, IN, and BETWEEN predicates, and that you know how NULL makes a comparison evaluate to unknown. Negating a predicate looks like a simple flip of true and false, but SQL has a third result, unknown, and negation does not flip it. Most surprises come fro6 min readWHERE clause. This chapter explains how the database groups those conditions, why the grouping often differs from what you meant, and how NULL affects the result. It assumes you can write 6 min readLIKE, IN, and BETWEEN conditions, and that you know NOT and NULL behave in surprising ways. You should also know what an index is: a sorted structure the database keeps beside a table so it can find rows without reading every one. The examples use standar7 min read