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.
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.
- 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
Practice business questions involving customers, orders, products, categories, employees, and sales, depending on the available database schema.
SQL practice involving airline-related records and analytical questions supported by the available tables.
Advanced SQL practice involving products, categories, customers, orders, and order items, subject to the available schema.
The project covers the following business questions:
- Identify the top five customers by total purchases.
- Analyze monthly sales trends by product.
- Identify top-selling product categories.
- Find orders with the highest quantities.
- Identify customers who have not ordered during a specified period.
- Analyze employee sales performance.
- Summarize sales by region using joins and aggregations.
- Rank orders using window functions.
Note: Results depend on the available database tables, query logic, and selected date ranges.
The advanced SQL practice file covers analytical approaches such as:
- Ranking products by revenue within each category.
- Summarizing monthly revenue and comparing it with the previous month.
- Ranking customers by order value.
- 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.
Open the SQL file to review the queries. Execute them against a compatible database with the required tables and columns.
- 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.
- 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.
- 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.
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.
- LinkedIn: Aman Barthria
- Email: amanbarthria@gmail.com




