FREE TUTORIALEVIKA ACADEMY
SQL Tutorial
Learn SQL from scratch — SELECT, WHERE, JOINs, aggregation, window functions, CTEs, and more. Every topic has real examples and exercises.
📦
One dataset used throughout
All examples in this tutorial use the same three tables — products, customers, and orders — so you build familiarity as you progress.
SQL Basics
Introduction
What is SQL? Databases, RDBMS, and how SQL works.
SQL Syntax
Statement structure, case sensitivity, semicolons.
SELECT
Retrieve data from a table.
SELECT DISTINCT
Return only unique values.
WHERE
Filter rows based on a condition.
AND, OR, NOT
Combine multiple conditions.
ORDER BY
Sort query results.
INSERT INTO
Add new rows to a table.
NULL Values
Handle missing data with IS NULL / IS NOT NULL.
UPDATE
Modify existing records.
DELETE
Remove rows from a table.
SELECT TOP / LIMIT
Restrict the number of rows returned.
SQL Aggregation
SQL Filtering & Conditionals
SQL Joins
Joins Overview
How joins work — Venn diagram explained.
INNER JOIN
Return only matching rows from both tables.
LEFT JOIN
All rows from left table + matches from right.
RIGHT JOIN
All rows from right table + matches from left.
FULL OUTER JOIN
All rows from both tables.
SELF JOIN
Join a table to itself.
CROSS JOIN
Cartesian product of two tables.
UNION
Combine result sets from multiple queries.
SQL Database & Schema
SQL Advanced
Subqueries
Queries nested inside other queries.
CTEs (WITH)
Named temporary result sets for readable queries.
Window Functions
OVER(), PARTITION BY — calculate across related rows.
ROW_NUMBER & RANK
Rank rows within partitions.
LAG & LEAD
Access values from previous or next rows.
String Functions
UPPER, LOWER, TRIM, SUBSTRING, REPLACE, CONCAT.
Date Functions
NOW, DATE_TRUNC, EXTRACT, DATEDIFF, DATE_ADD.
Numeric Functions
ROUND, CEIL, FLOOR, ABS, MOD, POWER.
EXISTS, ANY, ALL
Test subquery results for rows, ranges, sets.
Stored Procedures
Named, reusable SQL programs.
Want to go faster? Learn SQL with a mentor.
Live batches in Noida Sector 51. Hands-on projects, mock interviews, placement support.
Book Free Demo →