Learn SQL UNION and UNION ALL to stack results from two queries into one list. Syntax, worked examples with output, duplicates vs speed, and common mistakes.
Tag: SQL for Beginners
SQL Subqueries: Nested Queries in WHERE, FROM and SELECT
Learn SQL subqueries with worked examples: scalar and multi-row subqueries in WHERE, derived tables in FROM, correlated subqueries, NOT IN vs NOT EXISTS, and when to use a JOIN or CTE instead.
SQL EXISTS Operator: Test Whether a Subquery Returns Rows
SQL EXISTS tutorial: check whether a correlated subquery returns any rows, use NOT EXISTS to find missing matches, compare EXISTS vs IN vs JOIN, and avoid the NOT IN NULL trap, with worked examples and results.
SQL HAVING Clause: Filter Groups After GROUP BY (Examples)
Learn the SQL HAVING clause step by step: filter GROUP BY results with COUNT, SUM, AVG and MIN conditions, combine HAVING with WHERE, and avoid the errors beginners hit most often.
SQL GROUP BY Clause: Group Rows and Aggregate Data (Examples)
SQL GROUP BY tutorial with a sample Orders table: syntax table, COUNT, SUM and AVG per group, grouping by several columns and by month, WHERE vs HAVING, common errors with fixes and practice exercises.
SQL FULL JOIN: Combine All Rows from Both Tables (Examples)
SQL FULL JOIN tutorial: return all rows from both tables, NULL where no match, find mismatches on either side, and emulate FULL JOIN in MySQL and SQLite.
SQL RIGHT JOIN: Keep All Rows from the Right Table (Examples)
SQL RIGHT JOIN explained with sample tables and six worked examples: keep every row from the right table, find orphan records, use COALESCE, and avoid the WHERE-vs-ON trap.
SQL Joins Explained: INNER, LEFT, RIGHT and FULL JOIN Basics
SQL joins explained: how JOIN combines rows from two tables on a key, the four join types compared on one sample dataset, ON vs WHERE, and which join to use.
SQL Aliases: Rename Columns and Tables with AS (Examples)
SQL aliases explained with six worked examples: rename columns and tables with AS, name calculated columns, shorten joins, filter on an alias with a subquery, and avoid common alias errors.
SQL BETWEEN Operator: Filter Values in a Range (Examples)
SQL BETWEEN operator tutorial: filter numbers, dates and text within an inclusive range, use NOT BETWEEN, CASE bands and HAVING, avoid the end-of-day date trap, with seven examples and output.








