Loading topic
SELECT, WHERE, and ORDER BY queries and read basic boolean expressions such as a > 5 AND b = 2. It also assumes you have read the previous chapter on what NULL means. Here you learn the rule that decides how every NULL-related surprise behaves: SQL conditio5 min read= operator can't find NULLs and which similar queries fail5 min read= NULL never matches. Here you learn the operators SQL provides to test for NULL directly, and the NULL-safe comparison IS DISTINCT FROM. All examples use the5 min readSELECT and WHERE queries, and that you know the three-valued logic from the earlier chapters: a comparison with NULL gives UNKNOWN, not FALSE. Here you will see how NULL behaves inside expressions that compute values, such as sums, products and concatenat4 min readIS NULL is the way to test for it. Here you will use two standard functions to work with NULLs. COALESCE removes NULLs by substituting a value. NULLIF creates NULLs 5 min readSELECT, WHERE, and GROUP BY queries. It also assumes you know that a comparison with NULL yields UNKNOWN, as covered earlier. Here you will learn how aggregate functions treat NULL, why the same table can give several different "averages", and how to get the 5 min reademployees table below. Ada has no manager, and Ada and Cy have no commissi5 min readNULL behaves in comparisons and WHERE (earlier chapters), plus basic GROUP BY and aggregates. The examples use the employees table from the start of this tutorial: Ada (no manager, no commission), Ben (manager 1, commission 100), Cy (manager 1, no commission5 min readSELECT, WHERE, and ORDER BY queries. It also assumes you know that NULL marks a missing value and that comparisons with NULL yield UNKNOWN. It uses the employees table from the earlier chapters. In that table Ada and Cy have a NULL commission, Ben has 1006 min readIS NULL, aggregates, NOT IN, outer joins, and constraints. Earlier chapters showed how NULL behaves. This one covers when to let it into a schema at all.6 min readIS NULL, COALESCE, how aggregates skip NULLs, and the NOT IN trap. The core rules are the same in every mainstream database. The differences are in syntax, defaults, and a few surprising corners. They matter6 min read