7-Day SQL for Data Analysis Study Plan
Day 1: SQL Basics: SELECT, WHERE
Goals:
- Understand how to retrieve specific data from a table
- Filter rows with conditions
Topics:
- SELECT, FROM
- WHERE with =, >, <, BETWEEN, LIKE, IN, IS NULL
Practice:
- SQLBolt Lessons 1-3 (https://sqlbolt.com/)
- Example:
SELECT name, age FROM employees WHERE age > 30;
Day 2: Sorting, Limiting, and Simple Aggregates
Goals:
- Sort and limit results
- Use simple aggregate functions
Topics:
- ORDER BY, LIMIT
- COUNT(), SUM(), AVG(), MIN(), MAX()
Practice:
- SQLBolt Lessons 4-5 (https://sqlbolt.com/)
- Examples:
SELECT COUNT(*) FROM orders;
SELECT name FROM products ORDER BY price DESC LIMIT 5;
Day 3: GROUP BY and HAVING
7-Day SQL for Data Analysis Study Plan
Goals:
- Group data to analyze summaries
- Filter grouped results
Topics:
- GROUP BY, HAVING
Practice:
- SQLBolt Lesson 6 (https://sqlbolt.com/)
- Example:
SELECT department, AVG(salary)
FROM employees
GROUP BY department
HAVING AVG(salary) > 50000;
Day 4: JOINs (Merging Tables)
Goals:
- Combine multiple tables for analysis
Topics:
- INNER JOIN, LEFT JOIN, RIGHT JOIN
Practice:
- Mode SQL Tutorial: JOINs (https://mode.com/sql-tutorial/sql-joins/)
- Example:
SELECT c.name, o.order_date
FROM customers c
JOIN orders o ON c.id = o.customer_id;
Day 5: Subqueries and CASE Statements
Goals:
7-Day SQL for Data Analysis Study Plan
- Use subqueries for comparisons
- Create calculated columns
Topics:
- Subqueries in SELECT, WHERE
- CASE statement
Example:
SELECT name,
CASE
WHEN salary > 100000 THEN 'High'
ELSE 'Low'
END AS salary_group
FROM employees;
Day 6: Data Cleaning and COALESCE, NULLIF
Goals:
- Handle nulls and clean data
Topics:
- COALESCE(), NULLIF()
- Trimming, type casting
Example:
SELECT name, COALESCE(email, 'No Email') AS contact_email
FROM users;
Day 7: Window Functions & CTEs
Goals:
- Use advanced tools for row-by-row analysis
- Structure complex queries
7-Day SQL for Data Analysis Study Plan
Topics:
- ROW_NUMBER(), RANK(), OVER(PARTITION BY...)
- CTEs with WITH
Practice:
- Mode Window Functions (https://mode.com/sql-tutorial/sql-window-functions/)
- Example:
WITH ranked_sales AS (
SELECT salesperson, region,
RANK() OVER(PARTITION BY region ORDER BY total_sales DESC) as rank
FROM sales
SELECT * FROM ranked_sales WHERE rank = 1;