Welcome to the Flipkart SQL Project, a real-world e-commerce database schema designed for practicing SQL queries using real-time business use cases.
This repository contains:
- A complete schema of Flipkart-style tables
- Over 30+ analytical SQL queries
- Organized folders by SQL topic (Joins, Aggregations, Subqueries, etc.)
The database simulates a simplified version of Flipkart with the following key tables:
| Table Name | Description |
|---|---|
Customers |
Stores customer information like name, location, age, gender |
Products |
Holds product details such as category, brand, price |
Orders |
Records of customer orders, with order date, status |
OrderDetails |
Line-items for each order including product, quantity, price |
Sellers |
Seller profile with location and rating |
Categories |
Product category classifications |
Payments |
Payment type and transaction status |
Reviews |
Customer feedback and rating per product |
-
Import SQL Schema
Load theflipkart_schema.sqlinto your preferred RDBMS (MySQL/PostgreSQL/SQL Server). -
Sample Data
If sample data is included, importflipkart_sample_data.sql. -
Start Practicing Queries!
Navigate to thequeries/folder for categorized SQL questions.
Queries are grouped based on SQL learning phases:
- DDL & DML Operations
- SELECT, WHERE, ORDER BY
- Aggregate Functions (SUM, AVG, COUNT)
- GROUP BY + HAVING
- Basic Joins (INNER, LEFT, RIGHT)
- Subqueries (WHERE, SELECT, FROM)
- EXISTS / NOT EXISTS
- Views, CTEs
- String, Date, and Numeric Functions
- Set Operations (UNION, INTERSECT, EXCEPT)
- Window Functions (ROW_NUMBER, RANK, etc.)
- Revenue Trends, Top Products
- Customer Behavior Analysis
- Category-Wise Sales Performance
- Find top 5 selling products in Electronics
- Monthly revenue trend by category
- Customers with most canceled orders
- Compare average ratings by seller
- Identify most profitable product category