Skip to content

About

Advanced SQL business analysis project solving real-world business problems using JOINs, CTEs, Window Functions, Aggregations, and Subqueries.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

SQL Portfolio — Basic to Advanced Data Analytics

A SQL portfolio demonstrating database querying, business reporting, and data analysis through SQL practice projects. This repository includes SQL learning concepts and analytical queries related to Northwind, Airline, and Online Retail datasets, where applicable.

1. Project Overview

The objective of this project is to demonstrate SQL skills from basic querying to advanced data analysis techniques, including joins, aggregations, subqueries, Common Table Expressions (CTEs), and window functions.

The projects focus on answering business questions, summarizing data, identifying trends, and preparing structured analytical results.

2. Skills and SQL Concepts

  • SQL Fundamentals: SELECT, DISTINCT, WHERE, ORDER BY, LIMIT
  • Filtering: AND, OR, NOT, IN, BETWEEN, LIKE, IS NULL
  • Aggregations: COUNT, SUM, AVG, MIN, MAX
  • Grouping and Reporting: GROUP BY, HAVING, conditional aggregation
  • Joins: INNER JOIN, LEFT JOIN, and other joins where applicable
  • Subqueries: Nested queries and EXISTS / NOT EXISTS
  • CTEs: Common Table Expressions using WITH
  • Window Functions: ROW_NUMBER, RANK, DENSE_RANK, LAG, LEAD
  • Data Analysis: Ranking, monthly trends, revenue summaries, and customer analysis
  • Data Quality: NULL handling, duplicate checks, and validation

3. Datasets and Project Areas

Northwind Database

Practice business questions involving customers, orders, products, categories, employees, and sales, depending on the available database schema.

Airline Database

SQL practice involving airline-related records and analytical questions supported by the available tables.

Online Retail Dataset

Advanced SQL practice involving products, categories, customers, orders, and order items, subject to the available schema.

4. Northwind — Business Questions

The project covers the following business questions:

  1. Identify the top five customers by total purchases.
  2. Analyze monthly sales trends by product.
  3. Identify top-selling product categories.
  4. Find orders with the highest quantities.
  5. Identify customers who have not ordered during a specified period.
  6. Analyze employee sales performance.
  7. Summarize sales by region using joins and aggregations.
  8. Rank orders using window functions.

Note: Results depend on the available database tables, query logic, and selected date ranges.

5. Advanced SQL — Online Retail Analysis

The advanced SQL practice file covers analytical approaches such as:

  1. Ranking products by revenue within each category.
  2. Summarizing monthly revenue and comparing it with the previous month.
  3. Ranking customers by order value.
  4. Calculating category-level revenue and revenue contribution.

These analyses use techniques such as CTEs, joins, aggregation, and window functions where supported by the dataset schema.

6. SQL Query Screenshots

Original Advanced SQL Query

Original Advanced SQL Query

Advanced SQL Query — Screenshot 2

Advanced SQL Query — Screenshot 2

Advanced SQL Query — Screenshot 3

Advanced SQL Query — Screenshot 3

Advanced SQL Query — Screenshot 4

Advanced SQL Query — Screenshot 4

Advanced SQL Query — Screenshot 5

Advanced SQL Query — Screenshot 5

7. SQL Query Files

Open the SQL file to review the queries. Execute them against a compatible database with the required tables and columns.

8. Tools and Technologies

  • SQL
  • Relational databases
  • SQL joins and aggregations
  • CTEs and window functions
  • GitHub for project documentation and version control

Database compatibility: Use the SQL engine and version in which the queries were actually tested. SQL syntax may vary between database systems.

9. Query Writing Practices

  • Use clear and meaningful aliases.
  • Select only the columns needed for the analysis.
  • Validate joins and aggregation logic.
  • Handle NULL values carefully.
  • Check for duplicate records where relevant.
  • Document assumptions and date filters.
  • Verify query results against the available dataset.

10. Key Learning Outcomes

  • Writing SQL queries from basic to advanced levels.
  • Combining data from related tables.
  • Summarizing data for reporting and analysis.
  • Using CTEs and window functions for analytical tasks.
  • Translating business questions into structured SQL queries.
  • Documenting SQL work in a public project repository.

11. Project Notes

This repository is a learning and portfolio project. Business questions describe the intended analysis; actual findings should be reported only after the corresponding queries have been executed and their results verified. Dataset-specific queries may require changes to table names, column names, or SQL syntax.

Let's Connect

About

Advanced SQL business analysis project solving real-world business problems using JOINs, CTEs, Window Functions, Aggregations, and Subqueries.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors