SQL Tutorials
SQL is the first skill every data analyst learns and the one interviewers test the hardest. These tutorials cover the queries that actually show up in analyst work: joins that combine tables without duplicating rows, window functions that rank and compare without collapsing the result set, and the NULL handling and aggregation details that trip up even experienced candidates. Every example is runnable against a real database.
What you will learn
- ✓Choose the right join type and spot row multiplication from a non-unique key
- ✓Rank, partition and compare rows with ROW_NUMBER, RANK, DENSE_RANK, LAG and LEAD
- ✓Write GROUP BY and HAVING correctly and know when each filter runs
- ✓Handle NULLs with IS NULL, COALESCE and COUNT variants without silent bugs
- ✓Translate a business question into a single readable query with CTEs where needed
57 articles in this topic
5 Window Traps That Lie
Basket-split LAG gaps, ghost orders, nondeterministic ROW_NUMBER, RANK gaps, unframed running totals: 5 window traps with fixes and SQL included.
30 SQL Interview Questions, Free
The 30 SQL patterns analyst interviews repeat — JOINs, windows, GROUP BY traps, NULLs, dates, CTEs — indexed by pattern with live practice links.
4 GROUP BY Traps, Wrong vs Right
WHERE vs HAVING, nullable grouping keys, bare SELECT columns: 4 GROUP BY traps that run without errors yet fail take-homes, each with the fix.
Nested Query to CTE in 4 Steps
Turn a 3-level nested subquery into a readable CTE interviewers can maintain at 2am: a 4-step refactor worksheet with before-and-after SQL code.
5 SQL Date Patterns for Interviews
Month-over-month growth, rolling averages, cohorts, weekday splits, days-between events: the 5 SQL date patterns analyst JDs repeat, with queries.
Excel to SQL: Full Translation Map
VLOOKUP to JOIN, PivotTables to GROUP BY, filters to WHERE: every Excel skill mapped one-to-one to SQL, with a live practice path included inside.
RANK vs DENSE_RANK: Tie-Traps
Top-3-per-group with ties: ROW_NUMBER vs RANK vs DENSE_RANK explained side by side, plus 5 tie-trap drills with full answer keys for interviews.
Data Analyst Skills Roadmap (2026): What to Learn First
The modern 2026 data analyst skills roadmap. Learn the optimal order to master SQL, Excel, Python, and Tableau with free courses and real-world projects.
SQL Date Functions Guide: Practical Examples (2026)
Master sql date functions with practical examples. Learn DATE_TRUNC, EXTRACT, interval rolling windows, and how to avoid the timestamp BETWEEN trap.
Window Functions in SQL: Practical Guide & Examples
Master window functions in sql with practical examples. Learn OVER, PARTITION BY, running totals, rankings, and lead lag calculations step by step.
SQL Interview Questions for Experienced (2026 Guide)
Ace sql interview questions for experienced data analysts. Master window functions, query optimization, join fan-out, and scenario CTEs with code.
Understanding Null Semantics In Sql: 2026 Guide & Examples
Master three-valued logic and traps by understanding null semantics in sql. Learn NOT IN pitfalls, WHERE vs HAVING filtering, and safe COALESCE math.
Full Outer Join In Sql: 2026 Guide & Examples
Master the full outer join in sql with practical examples, billing reconciliation queries, syntax rules, and NULL handling for data analysts.
LEFT JOIN vs LEFT OUTER JOIN in SQL: Key Differences
Is there any difference between LEFT JOIN and LEFT OUTER JOIN in SQL? Learn ANSI syntax rules, performance benchmarks, and common WHERE clause traps.
Data Analyst Interview Questions 2026: Complete Preparation Guide
30+ real data analyst interview questions with schemas, solutions & pitfalls — SQL OAs vs live technical rounds, Python, modern data stack, product cases & behavioral.
SQL Interview Questions for Data Analyst (2026 Guide)
Master 2026 SQL interview questions for data analysts. Real queries, window functions, joins, common traps, and runnable code solutions.
SQL Joins Practice Exercises: 15 Real Queries & Answers
Master SQL joins with 15 real business practice exercises. Solve INNER, LEFT, RIGHT, FULL OUTER, CROSS, and SELF JOINs with schemas and expected outputs.
SQL Practice Questions: 25 Real Business Queries & Answers
Practice 25 real-world SQL queries with solutions, schema diagrams, and expected outputs. Master joins, window functions, and aggregations for interviews.
ROW_NUMBER vs RANK vs DENSE_RANK in SQL (Tie Examples)
Understand the exact difference between ROW_NUMBER(), RANK(), and DENSE_RANK() in SQL. See how ties are handled (1,2,3 vs 1,2,2,4 vs 1,2,2,3) with interactive queries.
SQL CTE Guide: WITH Clause Syntax, Chaining & Examples
Master SQL CTEs (Common Table Expressions). Learn WITH clause syntax, how to chain multiple CTEs, build recursive queries, and practice in our live sandbox.
30 SQL Interview Questions for Freshers & Analysts (2026)
Master top 30 SQL interview questions for freshers and analysts. Includes verified SQL queries for JOINs, Window Functions, CTEs, and GROUP BY.
SQL JOIN Fan-Out: How to Fix Duplicate Rows & Broken SUM
Fix duplicate rows and inflated SUM/AVG totals in SQL joins. Learn what causes join fan-out, how to pre-aggregate data, and solve classic interview traps.
UNION vs UNION ALL in SQL: Key Differences
Learn the difference between UNION and UNION ALL in SQL, why UNION ALL is faster, when deduplication matters, and how to avoid costly sorting overhead.
CREATE TABLE in MySQL: Syntax, Data Types & Constraints Guide
Master CREATE TABLE in MySQL with syntax examples, primary keys, foreign keys, AUTO_INCREMENT, constraints, and InnoDB engine best practices.
DDL SQL Commands: Complete Guide to Data Definition Language
Master DDL SQL commands: CREATE, ALTER, DROP, TRUNCATE, and RENAME with practical syntax, schema constraints, and DDL vs DML comparisons.
Delete Duplicate Records in SQL: 3 Proven Methods with Examples
Learn how to delete duplicate records in SQL using ROW_NUMBER() CTEs, self-joins with MIN/MAX IDs, and safe transaction workflows across dialects.
DML Commands in SQL: INSERT, UPDATE, DELETE, and MERGE (with Examples)
Master dml commands in sql: learn syntax for INSERT, UPDATE, DELETE, and MERGE, avoid catastrophic updates without WHERE, and compare DML vs DDL.
Normalization in SQL: 1NF, 2NF, 3NF & BCNF Explained with Examples
Learn normalization in sql with step-by-step table examples from unnormalized data to 1NF, 2NF, 3NF, and BCNF to eliminate data anomalies.
OFFSET in SQL: Syntax, Pagination & Performance Optimization
Master OFFSET in SQL for database pagination. Learn LIMIT/OFFSET syntax across dialects, deep pagination performance pitfalls, and keyset seek methods.
Order of Execution in SQL: The 8 Stages Every Analyst Must Understand
Master the order of execution in sql: learn how databases process FROM, WHERE, GROUP BY, HAVING, and SELECT clauses, and resolve query alias errors.
Set Operators in SQL: UNION, UNION ALL, INTERSECT & EXCEPT Guide
Master set operators in SQL with practical examples of UNION, UNION ALL, INTERSECT, and EXCEPT/MINUS to combine query result sets effectively.
Case Statement in SQL: Complete Guide to CASE WHEN & Conditional Aggregation
Master the case statement in sql: use CASE WHEN and SUM(CASE WHEN ...) to pivot data, categorize distributions, and aggregate conditionally in a single scan.
SQL Cheat Sheet: Commands, Queries, and Window Functions Reference
Bookmark this comprehensive sql cheat sheet: essential syntax for SELECT, JOINs, aggregations, Window Functions, CTEs, and query order of execution.
SQL COUNT Function: COUNT(*), COUNT(1) & COUNT(DISTINCT) Guide
Master the SQL COUNT function with examples of COUNT(*), COUNT(1), COUNT(DISTINCT), NULL handling, and conditional counting techniques.
SQL for Data Analyst: Complete Guide, Key Skills & Queries
Master SQL for data analyst roles with real-world query patterns, window functions, aggregations, cohort analysis, and practical workflows.
SQL Performance Tuning: 7 Proven Strategies to Accelerate Slow Queries
Master SQL performance tuning with execution plan analysis (EXPLAIN ANALYZE), indexing best practices, sargable queries, and join optimizations.
SQL Projects for All Levels: Beginner to Advanced Portfolio Guide
Stand out to hiring managers with these 6 real-world SQL projects for beginner, intermediate, and advanced data analysts with datasets and code.
SQL RANK Function: RANK vs DENSE_RANK vs ROW_NUMBER Guide
Master the SQL RANK function with side-by-side comparisons of RANK, DENSE_RANK, and ROW_NUMBER, PARTITION BY logic, and Top-N group queries.
Subquery in SQL: Single-Row, Correlated, and Nested Queries (with Examples)
Master subquery in sql: understand nested queries across SELECT, FROM, and WHERE clauses, correlated vs non-correlated subqueries, and performance fixes.
What Is SQL? The Complete Beginner to Pro Database Guide (2026)
What is SQL? Learn how Structured Query Language works, relational database concepts, SELECT queries, JOINs, DDL vs DML commands, and analyst workflows.
Amazon Data Analyst Interview Questions 2026: SQL, Cases & Solutions
Comprehensive 2026 guide to Amazon data analyst and analytics interviews. Round breakdowns, live SQL problem scenarios with code solutions, and compensation bands.
Flipkart Data Analyst Interview Questions 2026: SQL, Cases & Solutions
Comprehensive 2026 guide to Flipkart data analyst and analytics interviews. Round breakdowns, live SQL problem scenarios with code solutions, and compensation bands.
Google Data Analyst Interview Questions 2026: SQL, Cases & Solutions
Comprehensive 2026 guide to Google data analyst and analytics interviews. Round breakdowns, live SQL problem scenarios with code solutions, and compensation bands.
JPMorgan Chase Data Analyst Interview Questions 2026: SQL, Cases & Solutions
Comprehensive 2026 guide to JPMorgan Chase data analyst and analytics interviews. Round breakdowns, live SQL problem scenarios with code solutions, and compensation bands.
Razorpay Data Analyst Interview Questions 2026: SQL, Cases & Solutions
Comprehensive 2026 guide to Razorpay data analyst and analytics interviews. Round breakdowns, live SQL problem scenarios with code solutions, and compensation bands.
Swiggy Data Analyst Interview Questions 2026: SQL, Cases & Solutions
Comprehensive 2026 guide to Swiggy data analyst and analytics interviews. Round breakdowns, live SQL problem scenarios with code solutions, and compensation bands.
Uber Data Analyst Interview Questions 2026: SQL, Cases & Solutions
Comprehensive 2026 guide to Uber data analyst and analytics interviews. Round breakdowns, live SQL problem scenarios with code solutions, and compensation bands.
Walmart Global Tech Data Analyst Interview Questions 2026: SQL, Cases & Solutions
Comprehensive 2026 guide to Walmart Global Tech data analyst and analytics interviews. Round breakdowns, live SQL problem scenarios with code solutions, and compensation bands.
Zepto Data Analyst Interview Questions 2026: SQL, Cases & Solutions
Comprehensive 2026 guide to Zepto data analyst and analytics interviews. Round breakdowns, live SQL problem scenarios with code solutions, and compensation bands.
Zomato Data Analyst Interview Questions 2026: SQL, Cases & Solutions
Comprehensive 2026 guide to Zomato data analyst and analytics interviews. Round breakdowns, live SQL problem scenarios with code solutions, and compensation bands.
Connect VS Code to PostgreSQL with SQLTools (Step-by-Step)
Connect Visual Studio Code to PostgreSQL using SQLTools in 4 steps: install drivers, configure host/port credentials, fix search_path errors, and run queries.
WHERE vs HAVING in SQL: Execution Order & Key Differences
Master WHERE vs HAVING in SQL. Learn why WHERE filters before GROUP BY, why aggregate functions fail in WHERE, and the full 7-step query execution order.
SQL Subqueries Explained: Scalar, Correlated & Syntax Guide
Master the 3 types of SQL subqueries: scalar, multi-row (IN/EXISTS), and correlated. Avoid the NOT IN NULL trap and learn when to refactor to readable CTEs.
SQL vs NoSQL: Complete Guide for Data Analysts
Understand the differences between SQL and NoSQL databases. Learn when to use each and which to learn first.
Python Database Connectivity: SQLite to BigQuery Without Hardcoding Passwords
Connect Python to SQLite, PostgreSQL, MySQL, Snowflake and BigQuery with SQLAlchemy and pandas read_sql — securely via .env files.
Pandas Advanced Masterclass: Merge, Rank, and Window Functions Like SQL
Advanced Pandas — set_index, merge joins, rank vs dense_rank, shift/lead-lag, and groupby window functions mirroring SQL.
Tableau Relationships vs Joins: Which Should You Use & Why?
Compare Tableau Relationships vs Physical Joins. Learn how the logical layer (noodles) stops duplicated rows and inflated sums, and when to use classic joins.