Behind the query
From query to clarity.
See how tables connect and rows change through a query. Explore with isolated demo data, then put it into practice.
Put it into practiceHow tables connect
People (left)
Teams (right)
Matched pairLeft onlyRight only
Result
Each matching pair produces a row. NULL does not equal NULL with =. An unmatched side is filled with NULL; duplicate matches are retained.
FULL OUTER JOIN is an OurSQL compatibility extension for two named tables/views. SQL support lists its limits.
Example SQL needs the demo schema below; it does not use your school database.
Logical query processing
This is the logical teaching order, not a physical query plan or an EXPLAIN analyzer. Move through each step to see its rows.
SELECT team, COUNT(*) AS members FROM concept_people WHERE team IS NOT NULL GROUP BY team HAVING COUNT(*) > 1 ORDER BY members DESC LIMIT 1;