Welcome to my channel!
This video is perfect for beginners looking to learn SQL with real-world examples. We’ll walk through a SQL use case from food delivery apps like Swiggy, write practical SQL queries, and understand how data analysis with SQL is done in real applications. Ideal for those preparing for SQL interviews, data engineering jobs, or just looking to improve their SQL skills.
🔹 What You’ll Learn:
What is SQL? Simple explanation
Why SQL is essential for jobs and real-time analysis
Real-world SQL query example for order analysis
Where and how SQL is used in the real world
Step 1: Table Creation Script
CREATE TABLE Orders (
OrderID INT IDENTITY(1,1) PRIMARY KEY,
CustomerID INT,
Item NVARCHAR(50),
OrderDate DATE,
Amount DECIMAL(10,2)
);
-----
Step 2: Insert 2,000 Random Records (SQL Server)
-- Declare variables
DECLARE @i INT = 1;
DECLARE @CustomerID INT;
DECLARE @Item NVARCHAR(50);
DECLARE @OrderDate DATE;
DECLARE @Amount DECIMAL(10,2);
-- Sample items array (you can add more)
DECLARE @Items TABLE (ItemName NVARCHAR(50));
INSERT INTO @Items (ItemName)
VALUES ('Pizza'), ('Burger'), ('Pasta'), ('Biryani'), ('Sandwich'),
('Salad'), ('Coffee'), ('Tea'), ('Juice'), ('Ice Cream');
-- Insert loop
WHILE @i less than = 2000
BEGIN
SET @CustomerID = FLOOR(RAND() * 100) + 1; -- Customer IDs between 1 and 100
SELECT TOP 1 @Item = ItemName FROM @Items ORDER BY NEWID(); -- Random item
SET @OrderDate = DATEADD(DAY, -FLOOR(RAND() * 30), GETDATE()); -- Random date last 30 days
SET @Amount = CAST((RAND() * 500) + 50 AS DECIMAL(10,2)); -- Random amount 50–550
INSERT INTO Orders (CustomerID, Item, OrderDate, Amount)
VALUES (@CustomerID, @Item, @OrderDate, @Amount);
SET @i = @i + 1;
END;
----
💻 SQL Query Example in This Video:
```sql
SELECT item, COUNT(*) as order_count
FROM orders
WHERE order_date = '2025-04-14'
GROUP BY item
ORDER BY order_count DESC;
Who Should Watch?
Beginners who want to learn SQL from scratch
Students, job seekers, aspiring Data Engineers, Analysts, Developers
📌 Subscribe for more videos on:
SQL | Data Engineering | Python | Real-world Projects | Tech Tutorials
✅ Don’t forget to LIKE, SHARE, and COMMENT your favourite part of this video!
👉 Upcoming Video: Top 5 SQL Queries Every Beginner Should Know
Информация по комментариям в разработке