SQL Tutorial for Beginners | Learn SQL in 20 Minutes
Rohit Gupta
0:00 / 0:00
SQL Tutorial for Beginners | Learn SQL in 20 Minutes
151 просмотр · 2 нед. назад
Rohit Gupta
154 подписчика
151 просмотр · 2 нед. назад
SQL Tutorial for Beginners | Learn SQL in 20 Minutes
Want to learn SQL from scratch? 🚀 In this beginner-friendly SQL tutorial, you'll learn essential SQL concepts using a practical e-commerce database and real-world business questions.
Whether you're preparing for a Data Analyst interview, learning SQL for your career, or improving your data analysis skills, this tutorial will help you understand how to retrieve, filter, summarize, and analyze data using SQL.
📚 What You'll Learn
✅ Chapter 1: Filter Data with WHERE and AND
✅ Chapter 2: Aggregate Data with GROUP BY
✅ Chapter 3: Combine Tables with INNER JOIN
✅ Chapter 4: Filter and Control Query Results
🗄️Tables & Queries
DROP TABLE IF EXISTS users;
CREATE TABLE IF NOT EXISTS users(
user_id INT PRIMARY KEY,
user_name VARCHAR (100),
email VARCHAR (50),
city VARCHAR (50),
created_at TIMESTAMP
);
DROP TABLE IF EXISTS products;
CREATE TABLE IF NOT EXISTS products(
product_id INT PRIMARY KEY,
product_name VARCHAR (100),
category VARCHAR (100),
price DECIMAL (10,2)
);
DROP TABLE IF EXISTS orders;
CREATE TABLE IF NOT EXISTS orders(
order_id INT PRIMARY KEY,
user_id INT REFERENCES users(user_id),
product_id INT REFERENCES products(product_id),
amount DECIMAL(10,2),
status VARCHAR (30),
order_date TIMESTAMP
);
INSERT INTO users
(user_id, user_name, email, city, created_at)
VALUES
(1, 'Alice', 'alice@example.com', 'Mumbai', '2026-08-01 10:00:00'),
(2, 'Ben', 'ben@example.com', 'Delhi', '2026-08-02 11:00:00'),
(3, 'Cara', 'cara@example.com', 'Mumbai', '2026-08-03 12:00:00'),
(4, 'Dev', 'dev@example.com', NULL, '2026-08-04 13:00:00'),
(5, 'Esha', 'esha@example.com', 'Pune', '2026-08-05 14:00:00'),
(6, 'Farhan', 'farhan@example.com', 'Chennai', '2026-08-06 15:00:00');
INSERT INTO products
(product_id, product_name, category, price)
VALUES
(101, 'Keyboard', 'Electronics', 1500.00),
(102, 'Mouse', 'Electronics', 700.00),
(103, 'Bottle', 'Lifestyle', 500.00),
(104, 'Backpack', 'Accessories', 1200.00),
(105, 'Webcam', 'Electronics', 2500.00);
INSERT INTO orders
(order_id, user_id, product_id, amount, status, order_date)
VALUES
(1001, 1, 101, 1500.00, 'Completed', '2026-09-01 09:00:00'),
(1002, 1, 102, 700.00, 'Completed', '2026-09-02 10:00:00'),
(1003, 2, 101, 1500.00, 'Pending', '2026-09-03 11:00:00'),
(1004, 3, 104, 1200.00, 'Completed', '2026-09-04 12:00:00'),
(1005, 3, 103, 500.00, 'Cancelled', '2026-09-05 13:00:00'),
(1006, 4, 102, NULL, 'Pending', '2026-09-06 14:00:00'),
(1007, 2, 103, 500.00, 'Completed', '2026-09-07 15:00:00');
SELECT * FROM users;
SELECT * FROM products;
SELECT * FROM orders;
💼 Practice Real-World SQL Questions
Throughout this tutorial, you'll solve practical SQL problems based on an e-commerce database, including:
Finding completed and pending orders
Identifying orders above a specific amount
Calculating order counts, totals, and averages
Combining customer and product information
Finding products with multiple orders
Displaying results in pages using LIMIT and OFFSET
🎯 Who Should Watch This Video?
SQL beginners learning from scratch
Aspiring Data Analysts and Business Analysts
Students preparing for SQL interviews
Professionals improving their SQL skills
Anyone learning SQL for reporting and data analysis
🛠️ SQL Concepts Covered
SELECT | WHERE | AND | IS NULL | COUNT() | SUM() | AVG() | GROUP BY | INNER JOIN | DISTINCT | HAVING | ORDER BY | LIMIT | OFFSET
📌 Your challenge: Try writing the queries yourself before watching the solutions. Practicing each query will help you understand SQL faster.
If you found this tutorial helpful, like the video, subscribe to the channel, and comment below with the SQL topic you'd like to learn next.
#SQL #SQLTutorial #LearnSQL #SQLForBeginners #DataAnalyst #SQLInterviewQuestions #DataAnalytics