SQL For Data Analytics
This channel covers everything you need to learn SQL for data science, data analyst, data engineer and business analyst roles.
Больше📈 Аналитический обзор Telegram-канала SQL For Data Analytics
Канал SQL For Data Analytics (@mysqldata) языкового сегмента Английский является активным участником. Сейчас сообщество объединяет 10 259 подписчиков, занимая 19 281 место в категории Образование и 38 713 место в регионе Индия.
📊 Показатели аудитории и динамика
С момента создания невідомо проект демонстрирует стремительный рост, собрав аудиторию из 10 259 подписчиков.
Согласно последним данным от 08 июля, 2026, канал показывает стабильную активность. За последние 30 дней изменение числа участников составило 1 399, а за последние 24 часа — 22, при этом общий охват остаётся высоким.
- Статус верификации: Не верифицирован
- Уровень вовлечённости (ER): Средний показатель вовлечённости аудитории составляет 24.63%. В первые 24 часа после публикации контент обычно набирает 11.77% реакций от общего числа подписчиков.
- Охват публикаций: В среднем каждый пост получает 2 525 просмотров. В течение первых суток публикация набирает 1 207 просмотров.
- Реакции и взаимодействия: Аудитория активно поддерживает контент: среднее количество реакций на один пост — 14.
- Тематические интересы: Контент сосредоточен на ключевых темах, таких как sql, analyst, database, engineering, greeting.
📝 Описание и контентная политика
Автор описывает ресурс как площадку для выражения субъективного мнения:
“This channel covers everything you need to learn SQL for data science, data analyst, data engineer and business analyst roles.”
Благодаря высокой частоте обновлений (последние данные получены 09 июля, 2026) канал поддерживает актуальность и высокий уровень охвата публикаций. Аналитика показывает, что аудитория активно взаимодействует с контентом, что делает его важной точкой влияния в категории Образование.
COUNT(*) counts all rows, including those with NULLs.
- COUNT(column_name) counts only rows where the column is NOT NULL.
2️⃣ Q: When would you use GROUP BY with aggregate functions?
A:
Use GROUP BY when you want to apply aggregate functions per group (e.g., department-wise total salary):
SELECT department, SUM(salary) FROM employees GROUP BY department;
3️⃣ Q: What does the COALESCE() function do?
A:
COALESCE() returns the first non-null value from the list of arguments.
Example:
SELECT COALESCE(phone, 'N/A') FROM users;
4️⃣ Q: How does the CASE statement work in SQL?
A:
CASE is used for conditional logic inside queries.
Example:
SELECT name,
CASE
WHEN score >= 90 THEN 'A'
WHEN score >= 75 THEN 'B'
ELSE 'C'
END AS grade
FROM students;
5️⃣ Q: What’s the use of SUBSTRING() function?
A:
It extracts a part of a string.
Example:
SELECT SUBSTRING('DataScience', 1, 4); -- Output: Data
6️⃣ Q: What’s the output of LENGTH('SQL')?
A:
It returns the length of the string: 3
7️⃣ Q: How do you find the number of days between two dates?
A:
Use DATEDIFF(end_date, start_date)
Example:
SELECT DATEDIFF('2026-01-10', '2026-01-05'); -- Output: 5
8️⃣ Q: What does ROUND() do in SQL?
A:
It rounds a number to the specified decimal places.
Example:
SELECT ROUND(3.456, 2); -- Output: 3.46
💡 Pro Tip: Always mention real use cases when answering — it shows practical understanding.
💬 Tap ❤️ for more!SELECT column_name
FROM table_name;
How SQL executes:
1. Finds table (FROM)
2. Applies filter (WHERE)
3. Returns selected columns (SELECT)
4. Sorts results (ORDER BY)
5. Limits rows (LIMIT)
🔹 1. SELECT All Columns (SELECT *)
Used to retrieve every column from a table.
SELECT *
FROM employees;
👉 Returns complete table data.
📌 When to use:
✔ Exploring new dataset
✔ Checking table structure
✔ Quick testing
⚠️ Avoid in production: Slow on large tables, fetches unnecessary data.
🔹 2. SELECT Specific Columns
Best practice — retrieve only required data.
SELECT name, salary
FROM employees;
👉 Returns only selected columns.
💡 Why important:
✅ Faster queries
✅ Better performance
✅ Cleaner results
🔹 3. FROM Clause (Data Source)
Specifies where data comes from.
SELECT name
FROM customers;
👉 SQL reads data from customers table.
🔹 4. WHERE Clause (Filtering Data)
Used to filter rows based on conditions.
SELECT column
FROM table
WHERE condition;
Examples:
- Filter by value: SELECT * FROM employees WHERE salary > 50000;
- Filter by text: SELECT * FROM employees WHERE city = 'Mumbai';
🔹 5. ORDER BY (Sorting Results)
Sorts query results.
SELECT column
FROM table
ORDER BY column ASC | DESC;
Examples:
- Ascending: SELECT name, salary FROM employees ORDER BY salary ASC;
- Descending: SELECT name, salary FROM employees ORDER BY salary DESC;
🔹 6. LIMIT (Control Output Rows)
Restricts number of returned rows.
SELECT *
FROM employees
LIMIT 5;
👉 Returns first 5 records.
⭐ SQL Query Execution Order
1. FROM
2. WHERE
3. SELECT
4. ORDER BY
5. LIMIT
🧠 Real-World Example
Business question: "Show top 10 highest paid employees."
SELECT name, salary
FROM employees
ORDER BY salary DESC
LIMIT 10;
🚀 Mini Practice Tasks
✅ Task 1: Get all records from customers.
✅ Task 2: Show only customer name and city.
✅ Task 3: Find employees with salary > 40000.
✅ Task 4: Show top 3 highest priced products.
Double Tap ♥️ For Part-2GROUP BY does.
1️⃣ ROW_NUMBER()
Gives a unique number to each row in a partition.
SELECT name, dept_id,
ROW_NUMBER() OVER (
PARTITION BY dept_id
ORDER BY salary DESC
) AS rank
FROM employees;
📌 Use case: Rank employees by salary within each department.
2️⃣ RANK() vs DENSE_RANK()
⦁ RANK() → Skips numbers on ties (1, 2, 2, 4)
⦁ DENSE_RANK() → No gaps (1, 2, 2, 3)
SELECT name, salary,
RANK() OVER (ORDER BY salary DESC) AS rnk,
DENSE_RANK() OVER (ORDER BY salary DESC) AS dense_rnk
FROM employees;
3️⃣ LAG() and LEAD()
Access previous/next row values.
SELECT name, salary,
LAG(salary) OVER (ORDER BY id) AS prev_salary,
LEAD(salary) OVER (ORDER BY id) AS next_salary
FROM employees;
📌 Use case: Compare current row to previous/next (e.g., salary or stock change).
4️⃣ NTILE(n)
Divides rows into n buckets.
SELECT name,
NTILE(4) OVER (ORDER BY salary DESC) AS quartile
FROM employees;
📌 Use case: Quartiles/percentile-style grouping.
5️⃣ SUM(), AVG(), COUNT() with OVER()
Running totals, partition-wise aggregates, moving stats.
SELECT name, dept_id, salary,
SUM(salary) OVER (PARTITION BY dept_id) AS dept_total
FROM employees;
🧠 Interview Q&A
Q1: Difference between GROUP BY and OVER()?
⦁ GROUP BY → Collapses rows into groups; one row per group.
⦁ OVER() → Keeps all rows; adds an extra column with the aggregate.
Q2: When would you use LAG()?
To compare current row values with previous ones (e.g., day‑to‑day revenue change, previous month’s balance).
Q3: What happens if no PARTITION BY is used?
The function runs over the entire result set as a single partition.
Q4: Can you sort inside OVER()?
Yes, ORDER BY inside OVER() defines the calculation order (needed for ranking, LAG/LEAD, running totals).
💬 Double Tap ❤️ for more!