Top 25+ SQL Projects on GitHub You Should Explore in 2025
By Rohit Sharma
Updated on May 29, 2025 | 23 min read | 21.48K+ views
Share:
For working professionals
For fresh graduates
More
By Rohit Sharma
Updated on May 29, 2025 | 23 min read | 21.48K+ views
Share:
Did you know that SQL ranked seventh on the programming languages list in 2025, with a rating of 2.87%? This highlights the growing demand for SQL projects on GitHub, where developers can refine their skills and tackle data management and query optimization challenges.
SQL projects on GitHub offer a practical platform for learning advanced query optimization, data normalization, and transactional integrity. These projects span real-world use cases, from complex joins and nested queries to indexing strategies and database performance tuning.
By engaging with these projects, you’ll better understand relational databases, data manipulation techniques, and scalable solutions. Completing these projects enhances your proficiency in SQL, allowing you to tackle sophisticated problems in modern database systems.
In this blog, we will explore 25+ SQL Projects on GitHub that are relevant in modern data-driven organizations.
Want to sharpen your SQL skills for data-driven tasks? upGrad’s Artificial Intelligence & Machine Learning - AI ML Courses can equip you with tools and strategies to stay ahead. Enroll today!
SQL continues to be a critical tool for data manipulation, complex querying, data integration, and reporting in modern software systems. Learning advanced SQL techniques like window functions, recursive queries, and query optimization is essential for solving real-world problems efficiently. GitHub repositories provide a collaborative space for SQL practitioners, offering opportunities to work on real-world projects.
If you want to learn advanced computational skills to help you make successful SQL projects, the following courses can help you succeed.
Here is an overview of the top SQL projects on GitHub.
Project | Domain | Timeline |
SQL Database for Online Store | E-commerce | 2-4 weeks |
Social Media Data Analysis Dashboard | Marketing | 1-3 weeks |
Real-Time Stock Market Data Analysis | Finance | 3-5 weeks |
Library Management System | Education | 2-3 weeks |
SQL for Budget Tracking and Analysis | Finance | 2-4 weeks |
Employee Salary Distribution Analysis | HR | 2-3 weeks |
Movie Database Analysis | Entertainment | 1-3 weeks |
Shipping Logistics Optimization | Operations | 3-4 weeks |
Inventory Forecasting Model | Operations | 3-4 weeks |
Food Delivery Service Data Analysis | Logistics | 2-4 weeks |
Project Management Dashboard | Project Management | 2-3 weeks |
E-commerce Revenue Breakdown | Finance | 2-3 weeks |
Website Traffic Analysis | Marketing | 2-3 weeks |
Healthcare Data Analysis | Healthcare | 3-5 weeks |
Employee Performance Analysis | HR | 2-3 weeks |
Retail Purchase Prediction | Marketing | 3-4 weeks |
Sales Region Performance Analysis | Marketing | 2-3 weeks |
Customer Segmentation for Marketing | Marketing | 2-4 weeks |
Supplier Performance Monitoring | Operations | 3-4 weeks |
Product Pricing Optimization | Finance | 3-4 weeks |
Sales Trend Analysis | Marketing | 2-3 weeks |
Customer Churn Prediction | Marketing | 3-4 weeks |
Website Conversion Rate Optimization | Marketing | 2-3 weeks |
Employee Attrition Analysis | HR | 2-3 weeks |
Inventory Management Optimization | Operations | 3-4 weeks |
Market Basket Analysis | Marketing | 2-4 weeks |
Now that you’ve seen an overview of the top SQL projects on GitHub, let’s explore them in detail.
Beginner SQL projects on GitHub focus on foundational concepts such as database schema design, query optimization, and data manipulation. These projects will help you develop core SQL skills, including crafting efficient SELECT statements, working with joins, and performing aggregation and filtering operations.
Here are the top SQL projects for begineers:
An SQL database for an online store serves as the backbone for managing essential data like products, customers, orders, and payments. By designing normalized tables, you can create a structure that efficiently stores and queries transactional data. This project helps you learn how to manage relationships between different entities and ensures that your e-commerce system can handle large amounts of data with integrity.
Code Example:
CREATE TABLE customers (
customer_id INT PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50),
email VARCHAR(100) UNIQUE,
phone VARCHAR(15),
address VARCHAR(255)
);
Output:
Table 'customers' created with columns: customer_id, first_name, last_name, email, phone, address.
Output Explanation:
In this example, the customers table is created with essential fields for storing customer information. The customer_id is the primary key, ensuring each record is unique, and the email field is marked as unique to prevent duplicate entries.
This project involves creating an SQL database to analyze social media data such as user activity, posts, comments, and interactions. By using SQL to manage large datasets, you can derive actionable insights that help businesses improve their marketing strategies and engagement. This is a great SQL project on GitHub to contribute to, especially for those interested in social media analytics.
Code Example:
CREATE TABLE authors (
author_id INT PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50)
);
CREATE TABLE books (
book_id INT PRIMARY KEY,
title VARCHAR(100),
author_id INT,
genre VARCHAR(50),
publication_year INT,
FOREIGN KEY (author_id) REFERENCES authors(author_id)
);
CREATE TABLE borrowers (
borrower_id INT PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50),
email VARCHAR(100)
);
CREATE TABLE loans (
loan_id INT PRIMARY KEY,
book_id INT,
borrower_id INT,
loan_date DATE,
due_date DATE,
return_date DATE,
FOREIGN KEY (book_id) REFERENCES books(book_id),
FOREIGN KEY (borrower_id) REFERENCES borrowers(borrower_id)
);
Output:
-- Insert data into authors
INSERT INTO authors (author_id, first_name, last_name)
VALUES (1, 'J.K.', 'Rowling'), (2, 'George', 'Orwell');
-- Insert data into books
INSERT INTO books (book_id, title, author_id, genre, publication_year)
VALUES (1, 'Harry Potter and the Sorcerer\'s Stone', 1, 'Fantasy', 1997),
(2, '1984', 2, 'Dystopian', 1949);
-- Insert data into borrowers
INSERT INTO borrowers (borrower_id, first_name, last_name, email)
VALUES (1, 'Suraj', 'Patel', 'suraj.patel@example.com'),
(2, 'Naina', 'Chettri', 'naina.chettri@example.com');
-- Insert data into loans
INSERT INTO loans (loan_id, book_id, borrower_id, loan_date, due_date)
VALUES (1, 1, 1, '2025-05-10', '2025-06-10'),
(2, 2, 2, '2025-05-11', '2025-06-11');
Output Explanation:
You’ve set up tables for authors, books, borrowers, and loans with relationships between them. Sample data has been inserted, linking books and borrowers through the loans table.
Also Read: 15 Major Social Media Trends in 2025
In this SQL project on GitHub, you will create an SQL database to store and analyze real-time stock market data. The database will track stock prices, trading volumes, and market trends, which are key data points for stock market analysis.
Technology Stack and Tools:
Key Skills Gained:
Code Exmple:
CREATE TABLE stock_prices (
stock_id INT PRIMARY KEY,
symbol VARCHAR(10),
price DECIMAL(10, 2),
volume INT,
date TIMESTAMP
);
Output:
-- Insert data into stock_prices table
INSERT INTO stock_prices (stock_id, symbol, price, volume, date)
VALUES (1, 'AAPL', 145.30, 1000000, '2025-05-20 09:00:00'),
(2, 'GOOGL', 2734.56, 750000, '2025-05-20 09:00:00'),
(3, 'AMZN', 3368.00, 500000, '2025-05-20 09:00:00');
Output Explanation:
The stock_prices table is designed to store stock symbols, prices, volumes, and timestamps. Data is inserted for three stocks: AAPL, GOOGL, and AMZN, allowing you to track stock performance.
Also Read: Stock Market Prediction Using Machine Learning [Step-by-Step Implementation]
In this project, the goal is to create an SQL database to manage a library's inventory, including books, authors, borrowers, and due dates. This is a typical SQL project on GitHub where you can manage records efficiently using relational databases.
Code Example:
CREATE TABLE authors (
author_id INT PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50)
);
CREATE TABLE books (
book_id INT PRIMARY KEY,
title VARCHAR(100),
author_id INT,
genre VARCHAR(50),
publication_year INT,
FOREIGN KEY (author_id) REFERENCES authors(author_id)
);
CREATE TABLE borrowers (
borrower_id INT PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50),
email VARCHAR(100)
);
CREATE TABLE loans (
loan_id INT PRIMARY KEY,
book_id INT,
borrower_id INT,
loan_date DATE,
due_date DATE,
return_date DATE,
FOREIGN KEY (book_id) REFERENCES books(book_id),
FOREIGN KEY (borrower_id) REFERENCES borrowers(borrower_id)
);
Output:
-- Insert data into authors
INSERT INTO authors (author_id, first_name, last_name)
VALUES (1, 'J.K.', 'Rowling'), (2, 'George', 'Orwell');
-- Insert data into books
INSERT INTO books (book_id, title, author_id, genre, publication_year)
VALUES (1, 'Harry Potter and the Sorcerer\'s Stone', 1, 'Fantasy', 1997),
(2, '1984', 2, 'Dystopian', 1949);
-- Insert data into borrowers
INSERT INTO borrowers (borrower_id, first_name, last_name, email)
VALUES (1, Ramesh, 'Desai', 'ramesh.desai@example.com'),
(2, 'Radhika', 'Singh', 'radhika.singh@example.com');
-- Insert data into loans
INSERT INTO loans (loan_id, book_id, borrower_id, loan_date, due_date)
VALUES (1, 1, 1, '2025-05-10', '2025-06-10'),
(2, 2, 2, '2025-05-11', '2025-06-11');
Output Explanation:
You’ve set up tables for authors, books, borrowers, and loans with relationships between them. Sample data has been inserted, linking books and borrowers through the loans table.
Also Read: Library Management System Project Java: Design, Features, and Code
This project helps build an SQL database to track personal or business budgets, including income, expenses, and financial goals. SQL queries are used to analyze spending and generate reports, making it an ideal SQL project on GitHub for anyone interested in finance.
Technology Stack and Tools:
Key Skills Gained:
Applications:
Input:
CREATE TABLE transactions (
transaction_id INT PRIMARY KEY,
transaction_type VARCHAR(10), -- 'income' or 'expense'
amount DECIMAL(10, 2),
category VARCHAR(50),
transaction_date DATE
);
Output:
-- Insert data into transactions
INSERT INTO transactions (transaction_id, transaction_type, amount, category, transaction_date)
VALUES (1, 'income', 2000.00, 'Salary', '2025-05-01'),
(2, 'expense', 150.00, 'Groceries', '2025-05-02'),
(3, 'expense', 50.00, 'Transport', '2025-05-02');
Output Explanation:
The transactions table stores both income and expenses, allowing you to track financial transactions. Sample data has been inserted to track salary, groceries, and transport expenses.
This project builds an SQL database to manage and analyze employee salary distributions across roles, departments, and pay grades. By applying data analysis techniques, you can gain insights into salary trends and fairness in an Indian organizational context. As part of data science applications, this project helps HR departments and business analysts make data-driven decisions on compensation structures.
Code Example:
CREATE TABLE employees (
employee_id INT PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50),
department VARCHAR(50),
salary DECIMAL(10, 2),
city VARCHAR(50)
);
CREATE TABLE departments (
department_id INT PRIMARY KEY,
department_name VARCHAR(50)
);
Output:
-- Insert data into employees table
INSERT INTO employees (employee_id, first_name, last_name, department, salary, city)
VALUES (1, 'Ravi', 'Sharma', 'Engineering', 80000.00, 'Mumbai'),
(2, 'Priya', 'Singh', 'Marketing', 60000.00, 'Delhi'),
(3, 'Amit', 'Verma', 'HR', 50000.00, 'Bangalore');
-- Insert data into departments table
INSERT INTO departments (department_id, department_name)
VALUES (1, 'Engineering'),
(2, 'Marketing'),
(3, 'HR');
Output Explanation:
The employees table contains employee salary data, including Indian cities like Mumbai, Delhi, and Bangalore. The departments table contains data about different company departments.
This project creates an SQL database to manage a movie collection, including directors, genres, actors, and ratings. It helps in analyzing movie popularity and trends based on user ratings and viewing history. The system can be extended to create a data science-driven recommendation engine.
Code Example:
CREATE TABLE movies (
movie_id INT PRIMARY KEY,
title VARCHAR(100),
director VARCHAR(50),
genre VARCHAR(50),
release_year INT
);
CREATE TABLE ratings (
rating_id INT PRIMARY KEY,
movie_id INT,
user_id INT,
rating INT,
review_date TIMESTAMP,
FOREIGN KEY (movie_id) REFERENCES movies(movie_id)
);
Output:
-- Insert data into movies table
INSERT INTO movies (movie_id, title, director, genre, release_year)
VALUES (1, 'Dilwale Dulhania Le Jayenge', 'Aditya Chopra', 'Romance', 1995),
(2, 'Lagaan', 'Ashutosh Gowariker', 'Drama', 2001);
-- Insert data into ratings table
INSERT INTO ratings (rating_id, movie_id, user_id, rating, review_date)
VALUES (1, 1, 101, 5, '2025-05-20 10:00:00'),
(2, 2, 102, 4, '2025-05-20 11:00:00');
Output Explanation:
The movies table stores titles, director, genre, and release year data, with Indian movie examples like Dilwale Dulhania Le Jayenge and Lagaan. The ratings table tracks user ratings and reviews for each movie.
This project creates an SQL database to optimize shipping logistics, including inventory, shipping routes, and delivery times. By applying data analysis techniques, you can streamline supply chains and reduce operational costs. REST APIs can be used for real-time route optimization.
Code Example:
CREATE TABLE shipments (
shipment_id INT PRIMARY KEY,
product_name VARCHAR(50),
quantity INT,
origin_city VARCHAR(50),
destination_city VARCHAR(50),
delivery_date DATE
);
CREATE TABLE inventory (
product_id INT PRIMARY KEY,
product_name VARCHAR(50),
stock_quantity INT,
warehouse_location VARCHAR(50)
);
Output:
-- Insert data into shipments table
INSERT INTO shipments (shipment_id, product_name, quantity, origin_city, destination_city, delivery_date)
VALUES (1, 'Electronics', 50, 'Mumbai', 'Chennai', '2025-05-25'),
(2, 'Clothing', 200, 'Delhi', 'Kolkata', '2025-05-26');
-- Insert data into inventory table
INSERT INTO inventory (product_id, product_name, stock_quantity, warehouse_location)
VALUES (1, 'Electronics', 150, 'Mumbai Warehouse'),
(2, 'Clothing', 500, 'Delhi Warehouse');
Output Explanation:
The shipments table tracks product shipments from one city to another, with Indian cities like Mumbai, Delhi, Chennai, and Kolkata. The inventory table stores stock levels and locations of products in warehouses.
Also Read: What is Logistics Management? Overview, Types & Process
This project involves building an SQL database to track inventory levels and use historical data to forecast future inventory needs. The project can provide optimized inventory predictions by integrating data analysis techniques and machine learning models.
Code Example:
CREATE TABLE inventory_levels (
inventory_id INT PRIMARY KEY,
product_name VARCHAR(50),
quantity_in_stock INT,
last_updated DATE
);
CREATE TABLE sales (
sale_id INT PRIMARY KEY,
product_name VARCHAR(50),
sale_date DATE,
quantity_sold INT
);
Output:
-- Insert data into inventory_levels table
INSERT INTO inventory_levels (inventory_id, product_name, quantity_in_stock, last_updated)
VALUES (1, 'Smartphone', 100, '2025-05-15'),
(2, 'Laptop', 50, '2025-05-14');
-- Insert data into sales table
INSERT INTO sales (sale_id, product_name, sale_date, quantity_sold)
VALUES (1, 'Smartphone', '2025-05-10', 30),
(2, 'Laptop', '2025-05-12', 20);
Output Explanation:
The inventory_levels table stores product inventory data, and sales tracks product sales over time. This data can be used to analyze and forecast future inventory needs using machine learning techniques.
If you want to use AI for optimizing your workflows, check out upGrad’s Generative AI Mastery Certificate for Software Development. The program will help you learn how to integrate industry-relevant AI tools to your standard pipelines for better efficiency.
This project builds an SQL database to analyze food delivery data, such as orders, customer ratings, and delivery times. By performing data analysis and integrating REST APIs for real-time tracking, the system can optimize the delivery process.
Code Example:
CREATE TABLE food_orders (
order_id INT PRIMARY KEY,
customer_name VARCHAR(50),
restaurant_name VARCHAR(50),
order_date TIMESTAMP,
delivery_time INT, -- in minutes
rating INT
);
CREATE TABLE delivery_locations (
delivery_id INT PRIMARY KEY,
order_id INT,
latitude DECIMAL(9, 6),
longitude DECIMAL(9, 6),
FOREIGN KEY (order_id) REFERENCES food_orders(order_id)
);
Output:
-- Insert data into food_orders table
INSERT INTO food_orders (order_id, customer_name, restaurant_name, order_date, delivery_time, rating)
VALUES (1, 'Neha Sharma', 'Biryani Palace', '2025-05-20 12:00:00', 30, 5),
(2, 'Amit Verma', 'Pasta Hut', '2025-05-20 12:30:00', 45, 4);
-- Insert data into delivery_locations table
INSERT INTO delivery_locations (delivery_id, order_id, latitude, longitude)
VALUES (1, 1, 19.0760, 72.8777), -- Mumbai coordinates
(2, 2, 28.7041, 77.1025); -- Delhi coordinates
Output Explanation:
The food_orders table tracks food orders, including customer names, restaurant names, delivery times, and ratings. The delivery_locations table stores delivery location coordinates for real-time tracking.
This project creates an SQL database to track project management data, such as tasks, deadlines, teammates, and progress. By using data visualization tools, project performance can be monitored in real-time.
Code Example:
CREATE TABLE projects (
project_id INT PRIMARY KEY,
project_name VARCHAR(100),
start_date DATE,
end_date DATE,
status VARCHAR(50)
);
CREATE TABLE tasks (
task_id INT PRIMARY KEY,
project_id INT,
task_name VARCHAR(100),
assignee VARCHAR(50),
due_date DATE,
completion_status VARCHAR(50),
FOREIGN KEY (project_id) REFERENCES projects(project_id)
);
Output:
-- Insert data into projects table
INSERT INTO projects (project_id, project_name, start_date, end_date, status)
VALUES (1, 'Website Development', '2025-05-01', '2025-07-01', 'In Progress'),
(2, 'Mobile App Launch', '2025-05-05', '2025-06-30', 'Completed');
-- Insert data into tasks table
INSERT INTO tasks (task_id, project_id, task_name, assignee, due_date, completion_status)
VALUES (1, 1, 'Design Website Layout', 'Ravi Kumar', '2025-05-10', 'Completed'),
(2, 2, 'Create App Marketing Plan', 'Priya Patel', '2025-05-15', 'Pending');
Output Explanation:
The projects table stores details of each project, including start and end dates, project status, and project name. The tasks table tracks the status of each task and assigns them to team members for efficient management.
Discover how to use SQL for hypothesis formulation and solving complex business problems effectively with upGrad's free course on Introduction to Business Analytics.
For beginners, SQL projects GitHub will help master skills like creating databases and writing queries to manipulate data. For intermediate learners, check out the following SQL projects for data analysis GitHub.
SQL projects for data analysis GitHub will focus on more complex queries involving subqueries, window functions, and data aggregations to obtain insights. You will also focus on optimizing query performance and working with large datasets to recognize trends and patterns.
Here are the top intermediate SQL projects for data analysis GitHub.
This project analyzes e-commerce revenue by tracking sales across product categories, customer segments, and periods. The goal is to gain valuable insights into revenue trends, helping businesses optimize their offerings and marketing strategies.
Code Example:
CREATE TABLE products (
product_id INT PRIMARY KEY,
product_name VARCHAR(100),
category VARCHAR(50),
price DECIMAL(10, 2)
);
CREATE TABLE customers (
customer_id INT PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50),
city VARCHAR(50),
email VARCHAR(100) UNIQUE
);
CREATE TABLE transactions (
transaction_id INT PRIMARY KEY,
product_id INT,
customer_id INT,
quantity INT,
total_amount DECIMAL(10, 2),
transaction_date DATE,
FOREIGN KEY (product_id) REFERENCES products(product_id),
FOREIGN KEY (customer_id) REFERENCES customers(customer_id)
);
Output:
-- Insert data into products table
INSERT INTO products (product_id, product_name, category, price)
VALUES (1, 'Smartphone', 'Electronics', 25000.00),
(2, 'Laptop', 'Electronics', 50000.00),
(3, 'Headphones', 'Accessories', 1500.00);
-- Insert data into customers table
INSERT INTO customers (customer_id, first_name, last_name, city, email)
VALUES (1, 'Ravi', 'Sharma', 'Mumbai', 'ravi.sharma@example.com'),
(2, 'Priya', 'Singh', 'Delhi', 'priya.singh@example.com'),
(3, 'Amit', 'Verma', 'Bangalore', 'amit.verma@example.com');
-- Insert data into transactions table
INSERT INTO transactions (transaction_id, product_id, customer_id, quantity, total_amount, transaction_date)
VALUES (1, 1, 1, 2, 50000.00, '2025-05-10'),
(2, 2, 2, 1, 50000.00, '2025-05-11'),
(3, 3, 3, 3, 4500.00, '2025-05-12');
Output Explanation:
The products table tracks product information, including product names, categories, and prices. The customers table stores customer details, including names, cities, and emails. The transactions table logs sales data, linking products and customers through foreign keys.
If you want to learn how you can streamline your data analysis with AI, check out upGrad’s Master’s Degree in Artificial Intelligence and Data Science. The program will help youi learn critical tools and Python libraries for effective data analysis.
This project focuses on building an SQL database to analyze website traffic data, such as page views, user behavior, and session duration. The goal is to gain valuable insights into how traffic flows through your website, which traffic sources are most effective, and where users tend to drop off. Businesses can optimize user experience, increase engagement, and improve conversion rates by analyzing this data.
Code Example:
SELECT ts.source_name, SUM(tl.session_duration) AS total_session_duration
FROM traffic_logs tl
JOIN user_sessions us ON tl.log_id = us.session_id
JOIN traffic_sources ts ON us.source_id = ts.source_id
GROUP BY ts.source_name
ORDER BY total_session_duration DESC;
Output:
source_name | total_session_duration
------------------|------------------------
Organic Search | 1800
Paid Search | 240
Social Media | 600
Output Explanation:
This query calculates the total session duration for each traffic source, helping businesses identify the most engaging channels. The result can guide marketing strategies, such as increasing efforts in high-performing channels like Organic Search.
Also Read: How to Use Google Analytics: Comprehensive Guide For Beginners
This project focuses on analyzing healthcare data, such as patient records and treatment plans, to discover trends in patient demographics and treatment effectiveness. By utilizing SQL and R for advanced data analysis, healthcare providers can gain valuable insights into patient care patterns and treatment outcomes. This is a vital project for those looking to contribute to healthcare data analytics and build SQL projects on GitHub.
Code Example:
CREATE TABLE patients (
patient_id INT PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50),
age INT,
gender VARCHAR(10),
city VARCHAR(50)
);
CREATE TABLE treatments (
treatment_id INT PRIMARY KEY,
treatment_name VARCHAR(100),
treatment_type VARCHAR(50)
);
CREATE TABLE patient_treatments (
patient_id INT,
treatment_id INT,
treatment_start_date DATE,
treatment_end_date DATE,
outcome VARCHAR(50),
FOREIGN KEY (patient_id) REFERENCES patients(patient_id),
FOREIGN KEY (treatment_id) REFERENCES treatments(treatment_id)
);
Output:
-- Insert data into patients table
INSERT INTO patients (patient_id, first_name, last_name, age, gender, city)
VALUES (1, 'Ravi', 'Sharma', 45, 'Male', 'Mumbai'),
(2, 'Priya', 'Singh', 34, 'Female', 'Delhi'),
(3, 'Amit', 'Verma', 50, 'Male', 'Bangalore');
-- Insert data into treatments table
INSERT INTO treatments (treatment_id, treatment_name, treatment_type)
VALUES (1, 'Chemotherapy', 'Cancer'),
(2, 'Dialysis', 'Kidney Disease');
-- Insert data into patient_treatments table
INSERT INTO patient_treatments (patient_id, treatment_id, treatment_start_date, treatment_end_date, outcome)
VALUES (1, 1, '2025-05-01', '2025-05-30', 'Positive'),
(2, 2, '2025-06-01', '2025-06-30', 'Neutral'),
(3, 1, '2025-04-15', '2025-05-15', 'Negative');
Output Explanation:
The patients table stores patient information, including age, gender, and city (Indian cities like Mumbai, Delhi, and Bangalore). The treatments table stores information about medical treatments (e.g., Chemotherapy, Dialysis). The patient_treatments table links patients to treatments and stores treatment outcomes.
This project analyzes employee performance data, such as productivity rates, goal completion rates, and attendance, to identify top performers, detect performance trends, and recognize factors affecting employee productivity. By leveraging SQL and data analysis tools like Tableau, this project aims to provide actionable insights to HR departments and management for optimizing workforce performance.
Code Example:
CREATE TABLE employees (
employee_id INT PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50),
department VARCHAR(50),
hire_date DATE
);
CREATE TABLE performance_metrics (
performance_id INT PRIMARY KEY,
employee_id INT,
productivity_score DECIMAL(5, 2),
goals_completed INT,
attendance_rate DECIMAL(5, 2),
review_date DATE,
FOREIGN KEY (employee_id) REFERENCES employees(employee_id)
);
Output:
-- Insert data into employees table
INSERT INTO employees (employee_id, first_name, last_name, department, hire_date)
VALUES (1, 'Ravi', 'Sharma', 'Engineering', '2020-01-15'),
(2, 'Priya', 'Singh', 'Marketing', '2019-04-22'),
(3, 'Amit', 'Verma', 'Sales', '2021-06-30');
-- Insert data into performance_metrics table
INSERT INTO performance_metrics (performance_id, employee_id, productivity_score, goals_completed, attendance_rate, review_date)
VALUES (1, 1, 88.5, 5, 95.0, '2025-05-15'),
(2, 2, 76.3, 3, 98.0, '2025-05-15'),
(3, 3, 92.0, 6, 97.5, '2025-05-15');
Output Explanation:
The employees table stores basic employee information, including their department and hire date. The performance_metrics table tracks employee performance, including productivity scores, goals completed, and attendance rates, linked to the employees table via employee_id.
This project aims to predict future retail purchases based on historical sales data, customer behavior, and market trends. By leveraging SQL for aggregating and querying historical data, and integrating ML models like those in Scikit-learn, businesses can predict future buying patterns and optimize inventory and marketing strategies accordingly.
Code Example:
CREATE TABLE customers (
customer_id INT PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50),
gender VARCHAR(10),
city VARCHAR(50),
date_of_birth DATE
);
CREATE TABLE products (
product_id INT PRIMARY KEY,
product_name VARCHAR(100),
category VARCHAR(50),
price DECIMAL(10, 2)
);
CREATE TABLE transactions (
transaction_id INT PRIMARY KEY,
customer_id INT,
product_id INT,
quantity INT,
total_amount DECIMAL(10, 2),
transaction_date DATE,
FOREIGN KEY (customer_id) REFERENCES customers(customer_id),
FOREIGN KEY (product_id) REFERENCES products(product_id)
);
Output:
-- Insert data into customers table
INSERT INTO customers (customer_id, first_name, last_name, gender, city, date_of_birth)
VALUES (1, 'Ravi', 'Sharma', 'Male', 'Mumbai', '1985-01-10'),
(2, 'Priya', 'Singh', 'Female', 'Delhi', '1990-07-25'),
(3, 'Amit', 'Verma', 'Male', 'Bangalore', '1988-03-15');
-- Insert data into products table
INSERT INTO products (product_id, product_name, category, price)
VALUES (1, 'Smartphone', 'Electronics', 25000.00),
(2, 'Laptop', 'Electronics', 50000.00),
(3, 'Headphones', 'Accessories', 1500.00);
-- Insert data into transactions table
INSERT INTO transactions (transaction_id, customer_id, product_id, quantity, total_amount, transaction_date)
VALUES (1, 1, 1, 2, 50000.00, '2025-05-10'),
(2, 2, 2, 1, 50000.00, '2025-05-11'),
(3, 3, 3, 3, 4500.00, '2025-05-12');
Output Explanation:
The customers table contains customer information, including gender, city, and date_of_birth. The products table stores product information, such as product name, category, and price. The transactions table records sales transactions, linking customers and products through foreign keys, and stores transaction details such as quantity and total amount spent.
This project aims to analyze sales data across multiple regions to determine performance differences and optimize sales strategies. Using SQL, PostgreSQL, and Power BI, the project will help compare sales trends, customer behavior, and regional performance, leading to data-driven decision-making. This analysis allows businesses to adapt their sales strategies based on the strengths and weaknesses of each region.
Code Example:
CREATE TABLE regions (
region_id INT PRIMARY KEY,
region_name VARCHAR(100)
);
CREATE TABLE sales (
sale_id INT PRIMARY KEY,
region_id INT,
product_name VARCHAR(100),
quantity_sold INT,
total_sales DECIMAL(10, 2),
sale_date DATE,
FOREIGN KEY (region_id) REFERENCES regions(region_id)
);
CREATE TABLE customer_behavior (
behavior_id INT PRIMARY KEY,
region_id INT,
customer_id INT,
frequency INT, -- frequency of purchase
avg_purchase_value DECIMAL(10, 2),
FOREIGN KEY (region_id) REFERENCES regions(region_id)
);
Output:
-- Insert data into regions table
INSERT INTO regions (region_id, region_name)
VALUES (1, 'North India'),
(2, 'South India'),
(3, 'East India'),
(4, 'West India');
-- Insert data into sales table
INSERT INTO sales (sale_id, region_id, product_name, quantity_sold, total_sales, sale_date)
VALUES (1, 1, 'Smartphone', 200, 500000.00, '2025-05-10'),
(2, 2, 'Laptop', 150, 750000.00, '2025-05-10'),
(3, 3, 'Headphones', 300, 450000.00, '2025-05-10'),
(4, 4, 'Smartwatch', 100, 250000.00, '2025-05-10');
-- Insert data into customer_behavior table
INSERT INTO customer_behavior (behavior_id, region_id, customer_id, frequency, avg_purchase_value)
VALUES (1, 1, 101, 5, 25000.00),
(2, 2, 102, 3, 50000.00),
(3, 3, 103, 7, 15000.00),
(4, 4, 104, 2, 20000.00);
Output Explanation:
The regions table stores regional information (e.g., North India, South India, etc.). The sales table tracks product sales across regions, with product names, quantities sold, and total sales values. The customer_behavior table logs customer purchasing behavior, such as the frequency of purchases and average purchase value, per region.
Also read: Top 15 AWS Project Ideas for Beginners in 2025
The project seeks to segment customers based on their behavior and purchasing patterns. By creating different customer groups, businesses can analyze how effective various marketing campaigns are for each segment. SQL and machine learning clustering algorithms like K-Means (via Scikit-learn) will help identify distinct customer segments based on their attributes.
Code Example:
CREATE TABLE customers (
customer_id INT PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50),
gender VARCHAR(10),
city VARCHAR(50),
join_date DATE
);
CREATE TABLE purchases (
purchase_id INT PRIMARY KEY,
customer_id INT,
product_name VARCHAR(100),
purchase_date DATE,
amount DECIMAL(10, 2),
FOREIGN KEY (customer_id) REFERENCES customers(customer_id)
);
CREATE TABLE customer_engagement (
engagement_id INT PRIMARY KEY,
customer_id INT,
last_login DATE,
pages_visited INT,
FOREIGN KEY (customer_id) REFERENCES customers(customer_id)
);
Output:
-- Insert data into customers table
INSERT INTO customers (customer_id, first_name, last_name, gender, city, join_date)
VALUES (1, 'Ravi', 'Sharma', 'Male', 'Mumbai', '2022-01-10'),
(2, 'Priya', 'Singh', 'Female', 'Delhi', '2021-06-15'),
(3, 'Amit', 'Verma', 'Male', 'Bangalore', '2020-03-22');
-- Insert data into purchases table
INSERT INTO purchases (purchase_id, customer_id, product_name, purchase_date, amount)
VALUES (1, 1, 'Smartphone', '2025-05-10', 25000.00),
(2, 2, 'Laptop', '2025-05-11', 50000.00),
(3, 3, 'Headphones', '2025-05-12', 1500.00);
-- Insert data into customer_engagement table
INSERT INTO customer_engagement (engagement_id, customer_id, last_login, pages_visited)
VALUES (1, 1, '2025-05-09', 20),
(2, 2, '2025-05-10', 15),
(3, 3, '2025-05-11', 30);
Output Explanation:
The customers table stores customer demographic information such as gender, city, and join date. The purchases table records each customer’s purchases, linking to the customers table via customer_id.
Also Read: Segmentation in Marketing: Get Started with Effective Strategies
This project aims to monitor supplier performance, focusing on delivery times, product quality, and contract compliance, to ensure effective supply chain management. By leveraging SQL for querying supplier data, Tableau for visualizing performance metrics, and real-time performance monitoring systems, businesses can optimize their supply chain operations and make data-driven decisions.
Technology Stack and Tools:
Key Skills Gained:
Applications:
Code Example:
CREATE TABLE suppliers (
supplier_id INT PRIMARY KEY,
supplier_name VARCHAR(100),
contact_info VARCHAR(100),
region VARCHAR(50)
);
CREATE TABLE delivery_performance (
delivery_id INT PRIMARY KEY,
supplier_id INT,
delivery_date DATE,
scheduled_delivery_date DATE,
delivery_status VARCHAR(50),
FOREIGN KEY (supplier_id) REFERENCES suppliers(supplier_id)
);
CREATE TABLE product_quality (
quality_id INT PRIMARY KEY,
supplier_id INT,
product_name VARCHAR(100),
quality_rating DECIMAL(5, 2), -- Rating between 1 and 5
inspection_date DATE,
FOREIGN KEY (supplier_id) REFERENCES suppliers(supplier_id)
);
Output:
-- Insert data into suppliers table
INSERT INTO suppliers (supplier_id, supplier_name, contact_info, region)
VALUES (1, 'ABC Ltd.', 'abc@abc.com', 'North India'),
(2, 'XYZ Pvt. Ltd.', 'xyz@xyz.com', 'South India');
-- Insert data into delivery_performance table
INSERT INTO delivery_performance (delivery_id, supplier_id, delivery_date, scheduled_delivery_date, delivery_status)
VALUES (1, 1, '2025-05-01', '2025-05-01', 'On Time'),
(2, 2, '2025-05-03', '2025-05-02', 'Late');
-- Insert data into product_quality table
INSERT INTO product_quality (quality_id, supplier_id, product_name, quality_rating, inspection_date)
VALUES (1, 1, 'Smartphone', 4.8, '2025-05-01'),
(2, 2, 'Laptop', 3.5, '2025-05-02');
Output Explanation:
The suppliers table stores basic supplier information. The delivery_performance table tracks delivery performance metrics, including the actual delivery date, scheduled delivery date, and delivery status (e.g., On Time, Late).
This project aims to optimize product pricing by analyzing sales data, market demand, and competitor pricing to identify the optimal price points for products. By leveraging SQL for querying and aggregating data, and Scikit-learn for predictive pricing models, businesses can adjust their prices dynamically, improving their competitive position in the market and maximizing revenue.
Technology Stack and Tools:
Key Skills Gained:
Applications:
Code Example:
CREATE TABLE products (
product_id INT PRIMARY KEY,
product_name VARCHAR(100),
category VARCHAR(50),
base_price DECIMAL(10, 2)
);
CREATE TABLE sales (
sale_id INT PRIMARY KEY,
product_id INT,
quantity_sold INT,
sale_price DECIMAL(10, 2),
sale_date DATE,
FOREIGN KEY (product_id) REFERENCES products(product_id)
);
CREATE TABLE competitor_pricing (
competitor_id INT PRIMARY KEY,
product_id INT,
competitor_price DECIMAL(10, 2),
pricing_date DATE,
FOREIGN KEY (product_id) REFERENCES products(product_id)
);
Output:
-- Insert data into products table
INSERT INTO products (product_id, product_name, category, base_price)
VALUES (1, 'Smartphone', 'Electronics', 25000.00),
(2, 'Laptop', 'Electronics', 50000.00),
(3, 'Headphones', 'Accessories', 1500.00);
-- Insert data into sales table
INSERT INTO sales (sale_id, product_id, quantity_sold, sale_price, sale_date)
VALUES (1, 1, 100, 24000.00, '2025-05-01'),
(2, 2, 50, 48000.00, '2025-05-02'),
(3, 3, 200, 1400.00, '2025-05-03');
-- Insert data into competitor_pricing table
INSERT INTO competitor_pricing (competitor_id, product_id, competitor_price, pricing_date)
VALUES (1, 1, 24500.00, '2025-05-01'),
(2, 2, 49500.00, '2025-05-02'),
(3, 3, 1350.00, '2025-05-03');
Output Explanation:
The products table stores basic product information, including the base price. The sales table tracks the quantity sold, sale price, and the date of each sale. The competitor_pricing table tracks the prices set by competitors for each product.
Intermediate SQL projects for data analysis GitHub will help teach you to work with tables using joins and also the generation of reports for dashboards. If you’re looking to explore projects for experienced learners, check out the following section.
The advanced SQL projects for data analysis GitHub require you to work with techniques like optimization, large dataset management, and advanced analytics. You will be building real-world data challenges such as predictive modeling and performance tuning through these projects.
Here are some of the advanced SQL data analysis project GitHub.
The project analyzes sales data over time to identify patterns, seasonality, and trends. By exploring factors such as pricing, customer behavior, and seasonal fluctuations, the project helps businesses understand their sales performance and forecast future trends. The project can deliver actionable decision-making insights through SQL queries and Power BI dashboards.
Code Example:
CREATE TABLE products (
product_id INT PRIMARY KEY,
product_name VARCHAR(100),
category VARCHAR(50),
base_price DECIMAL(10, 2)
);
CREATE TABLE sales (
sale_id INT PRIMARY KEY,
product_id INT,
quantity_sold INT,
sale_price DECIMAL(10, 2),
sale_date DATE,
FOREIGN KEY (product_id) REFERENCES products(product_id)
);
CREATE TABLE promotions (
promo_id INT PRIMARY KEY,
product_id INT,
promo_type VARCHAR(50),
start_date DATE,
end_date DATE,
discount DECIMAL(5, 2), -- Discount percentage
FOREIGN KEY (product_id) REFERENCES products(product_id)
);
Output:
-- Insert data into products table
INSERT INTO products (product_id, product_name, category, base_price)
VALUES (1, 'Smartphone', 'Electronics', 25000.00),
(2, 'Laptop', 'Electronics', 50000.00),
(3, 'Headphones', 'Accessories', 1500.00);
-- Insert data into sales table
INSERT INTO sales (sale_id, product_id, quantity_sold, sale_price, sale_date)
VALUES (1, 1, 100, 24000.00, '2025-05-10'),
(2, 2, 50, 48000.00, '2025-05-11'),
(3, 3, 200, 1400.00, '2025-05-12');
-- Insert data into promotions table
INSERT INTO promotions (promo_id, product_id, promo_type, start_date, end_date, discount)
VALUES (1, 1, 'Flash Sale', '2025-05-01', '2025-05-03', 10.00),
(2, 2, 'Holiday Discount', '2025-05-05', '2025-05-10', 15.00);
Output Explanation:
The products table stores basic product information, including product name, category, and base price. The sales table tracks quantity sold, sale price, and sale date for each product. The promotions table tracks promotional activities, including the discount percentage, start and end dates, and promotion type.
The Customer Churn Prediction project aims to analyze historical customer behavior and transaction data to predict customer attrition (churn). By identifying factors that contribute to churn, businesses can take proactive actions to retain valuable customers. This project uses SQL for data cleaning, transformation, and feature extraction before feeding the data into machine learning models for churn prediction.
Code Example:
CREATE TABLE customers (
customer_id INT PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50),
gender VARCHAR(10),
city VARCHAR(50),
join_date DATE,
last_active DATE
);
CREATE TABLE transactions (
transaction_id INT PRIMARY KEY,
customer_id INT,
transaction_date DATE,
transaction_amount DECIMAL(10, 2),
FOREIGN KEY (customer_id) REFERENCES customers(customer_id)
);
CREATE TABLE customer_complaints (
complaint_id INT PRIMARY KEY,
customer_id INT,
complaint_date DATE,
complaint_type VARCHAR(50),
FOREIGN KEY (customer_id) REFERENCES customers(customer_id)
);
Output:
-- Insert data into customers table
INSERT INTO customers (customer_id, first_name, last_name, gender, city, join_date, last_active)
VALUES (1, 'Ravi', 'Sharma', 'Male', 'Mumbai', '2020-01-10', '2025-05-01'),
(2, 'Priya', 'Singh', 'Female', 'Delhi', '2019-06-15', '2025-04-28'),
(3, 'Amit', 'Verma', 'Male', 'Bangalore', '2021-02-22', '2025-05-05');
-- Insert data into transactions table
INSERT INTO transactions (transaction_id, customer_id, transaction_date, transaction_amount)
VALUES (1, 1, '2025-05-01', 1000.00),
(2, 2, '2025-04-25', 2500.00),
(3, 3, '2025-05-03', 1500.00);
-- Insert data into customer_complaints table
INSERT INTO customer_complaints (complaint_id, customer_id, complaint_date, complaint_type)
VALUES (1, 1, '2025-04-20', 'Shipping Delay'),
(2, 2, '2025-03-15', 'Product Defect');
Output Explanation:
The customers table stores customer demographics and activity data. The transactions table tracks customer transactions, including transaction amounts and dates. The customer_complaints table records any complaints made by customers, which could correlate with churn.
The Website Conversion Rate Optimization project focuses on analyzing website data to identify issues in the user journey and develop strategies to improve conversion rates. By using SQL for analyzing user flow, bounce rates, and conversion metrics, businesses can pinpoint friction points and optimize the user experience, leading to higher conversions.
Code Example:
CREATE TABLE users (
user_id INT PRIMARY KEY,
session_id VARCHAR(100),
user_agent VARCHAR(100),
country VARCHAR(50),
city VARCHAR(50)
);
CREATE TABLE page_visits (
visit_id INT PRIMARY KEY,
user_id INT,
page_url VARCHAR(255),
visit_time TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users(user_id)
);
CREATE TABLE conversions (
conversion_id INT PRIMARY KEY,
user_id INT,
conversion_time TIMESTAMP,
product_id INT,
purchase_amount DECIMAL(10, 2),
FOREIGN KEY (user_id) REFERENCES users(user_id)
);
Output:
-- Insert data into users table
INSERT INTO users (user_id, session_id, user_agent, country, city)
VALUES (1, 'ABC123', 'Mozilla/5.0', 'India', 'Mumbai'),
(2, 'DEF456', 'Chrome/91.0', 'India', 'Delhi'),
(3, 'XYZ789', 'Safari/537.36', 'India', 'Bangalore');
-- Insert data into page_visits table
INSERT INTO page_visits (visit_id, user_id, page_url, visit_time)
VALUES (1, 1, 'https://www.example.com/product/1', '2025-05-10 10:15:00'),
(2, 2, 'https://www.example.com/product/2', '2025-05-10 10:30:00'),
(3, 3, 'https://www.example.com/product/3', '2025-05-10 11:00:00');
-- Insert data into conversions table
INSERT INTO conversions (conversion_id, user_id, conversion_time, product_id, purchase_amount)
VALUES (1, 1, '2025-05-10 10:20:00', 1, 5000.00),
(2, 2, '2025-05-10 10:35:00', 2, 7000.00);
Output Explanation:
The users table tracks user-specific data such as user agent, location, and session ID. The page_visits table stores page visits, including the URL and visit time. The conversion table records successful conversions, including purchase details like product ID and purchase amount.
If you want to learn advanced ReactJS applications, check out upGrad’s React.js For Beginners. The 14-hour free certification will help you learn essential React components and analytical skills that are necessary for scalable data operations.
The Employee Attrition Analysis project aims to identify the key factors that contribute to employee turnover by analyzing historical employee data such as job satisfaction, performance, tenure, and survey results. By leveraging SQL for aggregating, correlating, and segmenting data, businesses can uncover patterns in employee attrition, helping HR teams develop strategies to retain top talent.
Technology Stack and Tools:
Key Skills Gained:
Applications:
Code Example:
CREATE TABLE employees (
employee_id INT PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50),
department VARCHAR(50),
role VARCHAR(50),
job_satisfaction DECIMAL(3, 2), -- Rating between 0 and 1
performance_score DECIMAL(3, 2), -- Rating between 0 and 1
hire_date DATE,
termination_date DATE
);
CREATE TABLE employee_surveys (
survey_id INT PRIMARY KEY,
employee_id INT,
survey_date DATE,
satisfaction_score DECIMAL(3, 2), -- Survey score between 0 and 1
feedback VARCHAR(255),
FOREIGN KEY (employee_id) REFERENCES employees(employee_id)
);
Output:
-- Insert data into employees table
INSERT INTO employees (employee_id, first_name, last_name, department, role, job_satisfaction, performance_score, hire_date, termination_date)
VALUES (1, 'Ravi', 'Sharma', 'Engineering', 'Software Engineer', 0.85, 0.92, '2020-01-10', '2025-05-01'),
(2, 'Priya', 'Singh', 'Marketing', 'Manager', 0.78, 0.75, '2019-06-15', '2025-04-20'),
(3, 'Amit', 'Verma', 'Sales', 'Sales Executive', 0.90, 0.80, '2021-02-22', NULL);
-- Insert data into employee_surveys table
INSERT INTO employee_surveys (survey_id, employee_id, survey_date, satisfaction_score, feedback)
VALUES (1, 1, '2025-04-15', 0.90, 'Satisfaction with current projects is high.'),
(2, 2, '2025-04-10', 0.70, 'Struggling with work-life balance.'),
(3, 3, '2025-04-20', 0.85, 'Happy with the work environment.');
Output Explanation:
The employee table stores demographics, job satisfaction, performance scores, and employment dates. The employee_surveys table tracks survey results, capturing employee feedback and satisfaction scores.
This project optimizes inventory levels based on historical sales data and demand forecasting. Using SQL to track inventory levels, sales trends, and demand patterns, businesses can minimize stockouts, prevent overstocking, and optimize inventory turnover. The project also uses Excel for advanced analysis and forecasting based on the data stored in MySQL.
Code Example:
CREATE TABLE products (
product_id INT PRIMARY KEY,
product_name VARCHAR(100),
category VARCHAR(50),
price DECIMAL(10, 2)
);
CREATE TABLE inventory (
inventory_id INT PRIMARY KEY,
product_id INT,
stock_level INT,
restock_date DATE,
FOREIGN KEY (product_id) REFERENCES products(product_id)
);
CREATE TABLE sales (
sale_id INT PRIMARY KEY,
product_id INT,
quantity_sold INT,
sale_date DATE,
FOREIGN KEY (product_id) REFERENCES products(product_id)
);
Output:
-- Insert data into products table
INSERT INTO products (product_id, product_name, category, price)
VALUES (1, 'Smartphone', 'Electronics', 25000.00),
(2, 'Laptop', 'Electronics', 50000.00),
(3, 'Headphones', 'Accessories', 1500.00);
-- Insert data into inventory table
INSERT INTO inventory (inventory_id, product_id, stock_level, restock_date)
VALUES (1, 1, 200, '2025-06-01'),
(2, 2, 50, '2025-05-25'),
(3, 3, 500, '2025-06-10');
-- Insert data into sales table
INSERT INTO sales (sale_id, product_id, quantity_sold, sale_date)
VALUES (1, 1, 100, '2025-05-10'),
(2, 2, 50, '2025-05-11'),
(3, 3, 300, '2025-05-12');
Output Explanation:
The products table stores product details like product name, category, and price. The inventory table tracks stock levels and restock dates. The sales table stores transaction data, including quantity sold and sale dates.
The Market Basket Analysis project focuses on analyzing customer transaction data to identify associations between frequently bought products. By using SQL to manage transaction data and the Apriori Algorithm for frequent itemset mining. Businesses can uncover product associations and design targeted promotions or bundling strategies to optimize sales and inventory.
Code Example:
CREATE TABLE products (
product_id INT PRIMARY KEY,
product_name VARCHAR(100),
category VARCHAR(50),
price DECIMAL(10, 2)
);
CREATE TABLE transactions (
transaction_id INT PRIMARY KEY,
transaction_date DATE
);
CREATE TABLE transaction_items (
transaction_item_id INT PRIMARY KEY,
transaction_id INT,
product_id INT,
quantity INT,
FOREIGN KEY (transaction_id) REFERENCES transactions(transaction_id),
FOREIGN KEY (product_id) REFERENCES products(product_id)
);
Output:
-- Insert data into products table
INSERT INTO products (product_id, product_name, category, price)
VALUES (1, 'Smartphone', 'Electronics', 25000.00),
(2, 'Laptop', 'Electronics', 50000.00),
(3, 'Headphones', 'Accessories', 1500.00),
(4, 'Smartwatch', 'Electronics', 10000.00),
(5, 'Charger', 'Accessories', 500.00);
-- Insert data into transactions table
INSERT INTO transactions (transaction_id, transaction_date)
VALUES (1, '2025-05-10'),
(2, '2025-05-11'),
(3, '2025-05-12');
-- Insert data into transaction_items table
INSERT INTO transaction_items (transaction_item_id, transaction_id, product_id, quantity)
VALUES (1, 1, 1, 1),
(2, 1, 3, 1),
(3, 2, 2, 1),
(4, 2, 4, 1),
(5, 3, 1, 2),
(6, 3, 5, 1);
Output Explanation:
The products table stores details about each product, including product name, category, and price. The transactions table records each transaction with a unique transaction ID and date.
Also read: Top 25 DBMS Projects [With Source Code] for Students in 2025
Advanced SQL data analysis projects GitHub will help you learn data modeling and query optimization for large datasets, which will be useful in practical applications. However, to master the subject and ensure your project stands out, you need to adopt certain strategies.
When showcasing your SQL projects on GitHub, the goal is to demonstrate technical proficiency through complex problem-solving and optimized query performance. Rather than focusing on basic tutorials, focus on tackling real-world challenges, optimizing your queries, and leveraging advanced SQL features to make your projects stand out.
Example Scenario:
Imagine developing a recommendation system for an e-commerce site. You’ll use RFM analysis to segment customers based on purchasing patterns and design a model to suggest products. Implementing indexed views to optimize queries ensures scalability even as the product catalog size grows. You’ll also integrate Apache Kafka to update recommendations in real-time as new data flows in.
Also read: Top 10 Real-Time SQL Project Ideas: For Beginners & Advanced
Now that you’ve explored the strategies that can make your SQL projects GitHub stand out, let’s look at ways to increase your knowledge of SQL.
Exploring SQL projects like Market Basket Analysis and Customer Churn Prediction will allow you to demonstrate proficiency in queries, data analysis, and machine learning integration. By utilizing tools such as PostgreSQL, Apache Kafka, and advanced SQL features like CTEs and indexed views, you can optimize performance and enhance scalability.
To make an impact, focus on tackling real-world challenges, optimizing query performance, and ensuring thorough documentation for clarity and future scalability. upGrad’s programs equip you with the tools and skills to integrate machine learning models with SQL data.
If you want to learn industry-relevant SQL skills for enterprise-grade applications. These are some of the additional courses for successful SQL projects.
Curious which courses can help you gain expertise in SQL? Contact upGrad for personalized counseling and valuable insights. For more details, you can also visit your nearest upGrad offline center.
Boost your career with our popular Software Engineering courses, offering hands-on training and expert guidance to turn you into a skilled software developer.
Master in-demand Software Development skills like coding, system design, DevOps, and agile methodologies to excel in today’s competitive tech industry.
Stay informed with our widely-read Software Development articles, covering everything from coding techniques to the latest advancements in software engineering.
References:
Source code:
763 articles published
Rohit Sharma shares insights, skill building advice, and practical tips tailored for professionals aiming to achieve their career goals.
Get Free Consultation
By submitting, I accept the T&C and
Privacy Policy
India’s #1 Tech University
Executive PG Certification in AI-Powered Full Stack Development
77%
seats filled
Top Resources