Date functions in SQL with examples: get the month or year, add days, find the gap between two dates, group by month, and the...
How to delete duplicate rows in SQL: find them with GROUP BY, keep the first or latest copy with MIN or ROW_NUMBER, fix MySQL...
The CASE statement in SQL explained: simple and searched CASE WHEN syntax, bucketing, NULL handling, CASE in GROUP BY, ORDER BY and UPDATE, with...
Normalization in SQL explained: 1NF, 2NF, 3NF and BCNF worked through one real order sheet, the anomalies they prevent, and when to denormalize.
Nested queries in SQL explained: subqueries in WHERE, FROM and SELECT, correlated subqueries, EXISTS vs IN, and the NOT IN NULL trap, with examples.
Views in SQL explained: what a view is, CREATE VIEW syntax, updatable and materialized views, and view vs table, with worked examples.
Primary key and foreign key in SQL explained with examples: how they link tables, composite keys, ON DELETE CASCADE, and UNIQUE, CHECK and NOT...
GROUP BY in SQL explained with examples: grouping by one or more columns, HAVING vs WHERE, the order SQL runs a query in, and...
CTE in SQL explained: what a common table expression is, WITH clause syntax, chained CTEs, recursive CTEs, and CTE vs subquery, with worked examples.
SQL aggregate functions explained with examples: COUNT, SUM, AVG, MIN and MAX, how they treat NULL, COUNT DISTINCT, and conditional aggregation.