Loading topic
SELECT ... FROM ... WHERE query. It also assumes you know what primary and foreign keys are, how NULL behaves in comparisons, and how to write an INNER JOIN ... ON. Here you build the mental model that the next chapters use for LEFT, RIGHT and `FU6 min readSELECT ... FROM ... WHERE query. You should know what primary and foreign keys are, and that NULL means "no value" and not zero or an empty string. You should also have written an INNER JOIN ... ON query. This chapter covers how LEFT JOIN works and6 min readSELECT, FROM and WHERE, primary and foreign keys, INNER JOIN ... ON, and that NULL means "no value or unknown value" in SQL. It builds on the LEFT JOIN chapter, where unmatched rows first appeared with NULLs. Here you learn to read those NULLs correctly.5 min readLEFT JOIN, you understand NULL padding, and you know the difference between a filter in ON and one in WHERE. Earlier chapters covered these. Here we show that RIGHT JOIN is the same operation with the tables swapped, and we cover the few cases where the d6 min readSELECT ... WHERE query and an INNER JOIN ... ON. It also assumes you know that NULL means "no value" and that NULL = NULL is not true. The chapter builds on the LEFT JOIN and NULL padding from the previous chapters.5 min readNULL behaves in comparisons, and you have written an INNER JOIN ... ON. It uses the customers and orders tables from the earlier chapters. Ada has orders 101 and 102, Ben has order 103, Cleo has no orders, and o6 min readSELECT ... WHERE queries and INNER JOIN ... ON. It also assumes you know how LEFT JOIN pads unmatched rows with NULL, and why a WHERE filter on the right table can undo a left join. Here you will see what happens when both sides of a join are preserved.6 min readcustomers and orders tables from earlier in this tutorial. The focus here is row counts. A join can return more rows than either input table has, and that changes what `COUNT5 min readSELECT, WHERE and GROUP BY, understand NULL, and know the LEFT JOIN syntax from the earlier chapters. All examples use the same customers and orders tables as the rest of the tutorial.6 min readLEFT JOIN and INNER JOIN with an ON condition. It also assumes you know why unmatched rows come back with NULL and how a filter in ON differs from one in WHERE. Real queries rarely join just two tables. Once you chain joins, a new class of bugs appears:6 min readFULL OUTER JOIN. This chapter shows how to get the same result from joins they do support. It also covers the mistakes that make the emulation return wrong rows.6 min readWHERE ... IS NULL finds unmatched rows, and understand that comparing anything to NULL gives "unknown" rather than true or false. It uses the same customers and orders tables as the earlier chapters. Cleo has no orders,7 min read