Data Analytics
Perfect channel to learn Data Analytics Learn SQL, Python, Alteryx, Tableau, Power BI and many more For Promotions: @coderfun @love_data
Показати більше📈 Аналітичний огляд Telegram-каналу Data Analytics
Канал Data Analytics (@sqlspecialist) у мовному сегменті Англійська є активним учасником. На даний момент спільнота об'єднує 109 681 підписників, посідаючи 1 122 місце в категорії Технології та додатки та 2 340 місце у регіоні Індія.
📊 Показники аудиторії та динаміка
З моменту свого створення невідомо, проект продемонстрував стрімке зростання, зібравши аудиторію у 109 681 підписників.
За останніми даними від 24 червня, 2026, канал демонструє стабільну активність. Хоча за останні 30 днів спостерігається зміна кількості учасників на 584, а за останні 24 години на 71, загальне охоплення залишається високим.
- Статус верифікації: Не верифікований
- Рівень залученості (ER): Середній показник залученості аудиторії становить 2.76%. Протягом перших 24 годин після публікації контент зазвичай збирає 0.68% реакцій від загальної кількості підписників.
- Охоплення публікацій: В середньому кожен допис отримує 3 024 переглядів. Протягом першої доби публікація в середньому набирає 743 переглядів.
- Реакції та взаємодія: Аудиторія активно підтримує контент: середня кількість реакцій на один пост – 8.
- Тематичні інтереси: Контент зосереджений навколо ключових тем, таких як row, sql, analytic, analyst, visualization.
📝 Опис та контентна політика
Автор описує ресурс як майданчик для висловлення суб'єктивної думки:
“Perfect channel to learn Data Analytics
Learn SQL, Python, Alteryx, Tableau, Power BI and many more
For Promotions: @coderfun @love_data”
Завдяки високій частоті оновлень (останні дані отримано 25 червня, 2026), канал підтримує актуальність та високий рівень охоплення публікацій. Аналітика показує, що аудиторія активно взаємодіє з контентом, що робить його важливою точкою впливу в категорії Технології та додатки.
SELECT column1, column2, window_function() OVER (PARTITION BY column ORDER BY column) AS alias FROM table_name;
✔ PARTITION BY groups rows before applying the function
✔ ORDER BY determines the ranking or sequence
3️⃣ Using ROW_NUMBER()
🔹 Assign a unique row number to each employee based on salary (highest first)
SELECT name, department, salary, ROW_NUMBER() OVER (PARTITION BY department ORDER BY salary DESC) AS row_num FROM employees;
✔ Each employee gets a unique row number within their department.
4️⃣ Using RANK() and DENSE_RANK()
🔹 Rank employees by salary within each department
SELECT name, department, salary, RANK() OVER (PARTITION BY department ORDER BY salary DESC) AS rank, DENSE_RANK() OVER (PARTITION BY department ORDER BY salary DESC) AS dense_rank FROM employees;
✔ RANK() skips numbers when there’s a tie
✔ DENSE_RANK() does not skip numbers
5️⃣ Using NTILE() for Distribution
🔹 Divide employees into 4 salary groups per department
SELECT name, department, salary, NTILE(4) OVER (PARTITION BY department ORDER BY salary DESC) AS salary_quartile FROM employees;
✔ Useful for dividing salaries into percentiles (e.g., top 25%, bottom 25%)
6️⃣ Running Total with SUM() OVER()
🔹 Calculate cumulative salary per department
SELECT name, department, salary, SUM(salary) OVER (PARTITION BY department ORDER BY salary DESC) AS running_total FROM employees;
✔ Useful for tracking cumulative totals
7️⃣ Using LAG() and LEAD()
🔹 Compare an employee’s salary with the previous and next employee’s salary
SELECT name, department, salary, LAG(salary) OVER (PARTITION BY department ORDER BY salary DESC) AS previous_salary, LEAD(salary) OVER (PARTITION BY department ORDER BY salary DESC) AS next_salary FROM employees;
✔ LAG() gets the previous row’s value
✔ LEAD() gets the next row’s value
Mini Task for You: Write an SQL query to assign a unique rank to employees based on their salary within each department using RANK().SELECT column1, column2, window_function() OVER (PARTITION BY column ORDER BY column) AS alias FROM table_name;
✔ PARTITION BY groups rows before applying the function
✔ ORDER BY determines the ranking or sequence
3️⃣ Using ROW_NUMBER()
🔹 Assign a unique row number to each employee based on salary (highest first)
SQL
SELECT name, department, salary, ROW_NUMBER() OVER (PARTITION BY department ORDER BY salary DESC) AS row_num FROM employees;
✔ Each employee gets a unique row number within their department. 4️⃣ Using RANK() and DENSE_RANK() 🔹 Rank employees by salary within each departmentSQL
SELECT name, department, salary, RANK() OVER (PARTITION BY department ORDER BY salary DESC) AS rank, DENSE_RANK() OVER (PARTITION BY department ORDER BY salary DESC) AS dense_rank FROM employees;
✔ RANK() skips numbers when there’s a tie ✔ DENSE_RANK() does not skip numbers 5️⃣ Using NTILE() for Distribution 🔹 Divide employees into 4 salary groups per departmentSQL
SELECT name, department, salary, NTILE(4) OVER (PARTITION BY department ORDER BY salary DESC) AS salary_quartile FROM employees;
✔ Useful for dividing salaries into percentiles (e.g., top 25%, bottom 25%) 6️⃣ Running Total with SUM() OVER() 🔹 Calculate cumulative salary per departmentSQL
SELECT name, department, salary, SUM(salary) OVER (PARTITION BY department ORDER BY salary DESC) AS running_total FROM employees;
✔ Useful for tracking cumulative totals 7️⃣ Using LAG() and LEAD() 🔹 Compare an employee’s salary with the previous and next employee’s salarySQL
SELECT name, department, salary, LAG(salary) OVER (PARTITION BY department ORDER BY salary DESC) AS previous_salary, LEAD(salary) OVER (PARTITION BY department ORDER BY salary DESC) AS next_salary FROM employees; `
✔ LAG() gets the previous row’s value
✔ LEAD() gets the next row’s value
Mini Task for You: Write an SQL query to assign a unique rank to employees based on their salary within each department using RANK().WITH cte_name AS ( SELECT column1, column2 FROM table_name WHERE condition ) SELECT * FROM cte_name;
✔ The CTE cte_name is defined and then used in the main SELECT query.
2️⃣ Simple CTE Example
🔹 Find employees earning more than $70,000
WITH high_earners AS ( SELECT name, salary, department_id FROM employees WHERE salary > 70000 ) SELECT * FROM high_earners;
✔ The CTE high_earners filters employees with high salaries before selecting all columns from it.
3️⃣ CTE with Aggregation
🔹 Find departments where the average salary is above $80,000
WITH department_salary AS ( SELECT department_id, AVG(salary) AS avg_salary FROM employees GROUP BY department_id ) SELECT department_id, avg_salary FROM department_salary WHERE avg_salary > 80000;
✔ The CTE department_salary calculates the average salary per department and filters out low-paying ones.
4️⃣ CTE for Recursive Queries (Hierarchy Example)
🔹 Find an employee hierarchy (who reports to whom)
WITH RECURSIVE employee_hierarchy AS ( SELECT employee_id, name, manager_id FROM employees WHERE manager_id IS NULL -- Start with top-level manager UNION ALL SELECT e.employee_id, e.name, e.manager_id FROM employees e INNER JOIN employee_hierarchy eh ON e.manager_id = eh.employee_id ) SELECT * FROM employee_hierarchy;
✔ This recursive CTE finds an employee hierarchy starting from the top-level manager.
5️⃣ Why Use CTEs Instead of Subqueries?
✅ Better Readability – Makes complex queries easier to understand
✅ Reusability – Can be referenced multiple times in the main query
✅ Performance – Some databases optimize CTEs better than nested subqueries
Mini Task for You: Write an SQL query using a CTE to find departments with more than 5 employees.
You can find free SQL Resources here
👇👇
https://t.me/mysqldata
Like this post if you want me to continue covering all the topics! ❤️
Share with credits: https://t.me/sqlspecialist
Hope it helps :)
#sqlSELECT employees.name, employees.salary, departments.department_name FROM employees INNER JOIN departments ON employees.department_id = departments.department_id;
✔ Returns only employees who have a matching department.
3️⃣ LEFT JOIN (Includes Unmatched Rows from Left Table)
🔹 Find all employees, including those without a department
SELECT employees.name, employees.salary, departments.department_name FROM employees LEFT JOIN departments ON employees.department_id = departments.department_id;
✔ Includes employees even if they don’t have a department (NULL if no match).
4️⃣ RIGHT JOIN (Includes Unmatched Rows from Right Table)
🔹 Find all departments, including those without employees
SELECT employees.name, employees.salary, departments.department_name FROM employees RIGHT JOIN departments ON employees.department_id = departments.department_id;
✔ Includes all departments, even if no employees are assigned.
5️⃣ FULL JOIN (Includes Unmatched Rows from Both Tables)
🔹 Get a complete list of employees and departments (matched + unmatched rows)
SELECT employees.name, employees.salary, departments.department_name FROM employees FULL JOIN departments ON employees.department_id = departments.department_id;
✔ Includes all employees and departments even if there’s no match.SELECT department, COUNT(*) FROM employees GROUP BY department;
This groups employees by department and counts the number of employees in each department.
🔹 Find the total salary per department
SELECT department, SUM(salary) FROM employees GROUP BY department;
2️⃣ GROUP BY with Multiple Columns
You can group by multiple columns to analyze data more deeply.
🔹 Find the total salary for each job title within each department
SELECT department, job_title, SUM(salary) FROM employees GROUP BY department, job_title;
3️⃣ Using HAVING to Filter Groups
Unlike WHERE, which filters before aggregation, HAVING filters after aggregation.
🔹 Find departments with more than 5 employees
SELECT department, COUNT(*) AS employee_count FROM employees GROUP BY department HAVING COUNT(*) > 5;
🔹 Find departments where the total salary is greater than $500,000
SELECT department, SUM(salary) AS total_salary FROM employees GROUP BY department HAVING SUM(salary) > 500000;
🔹 Find job titles where the average salary is above $70,000
SELECT job_title, AVG(salary) AS avg_salary FROM employees GROUP BY job_title HAVING AVG(salary) > 70000;
4️⃣ GROUP BY with ORDER BY
To sort grouped results, use ORDER BY.
🔹 Find the total salary per department, sorted in descending order
SELECT department, SUM(salary) AS total_salary FROM employees GROUP BY department ORDER BY total_salary DESC;
Mini Task for You:
Write an SQL query to find departments where the average salary is more than $80,000.
Let me know when you’re ready to move to the next topic! 🚀SELECT order_id, customer_id, sales_amount, CASE WHEN sales_amount > 1000 THEN 'High' WHEN sales_amount BETWEEN 500 AND 1000 THEN 'Medium' ELSE 'Low' END AS sales_category FROM sales;
✅ This classifies each sale as High, Medium, or Low based on sales_amount.
Example 2: Handling NULL Values
SELECT employee_id, CASE WHEN department IS NULL THEN 'Not Assigned' ELSE department END AS department_status FROM employees;
✅ This replaces NULL values in the department column with "Not Assigned".
Example 3: Conditional Aggregation in Reports
SELECT SUM(CASE WHEN order_status = 'Completed' THEN total_amount ELSE 0 END) AS completed_sales, SUM(CASE WHEN order_status = 'Pending' THEN total_amount ELSE 0 END) AS pending_sales FROM orders;
✅ This calculates total sales separately for "Completed" and "Pending" orders.
Top 20 SQL Interview Questions
React with ❤️ if you want similar Interview Series for other data analytics topics
Share with credits: https://t.me/sqlspecialist
Hope it helps :)SELECT category_id, SUM(sales_amount) AS category_sales, (SUM(sales_amount) * 100.0) / SUM(SUM(sales_amount)) OVER () AS sales_percentage FROM sales GROUP BY category_id;
Explanation:
1️⃣ SUM(sales_amount) OVER () calculates the total sales across all categories.
2️⃣ SUM(sales_amount) * 100.0 / total_sales computes the percentage for each category.
3️⃣ GROUP BY category_id ensures aggregation at the category level.
Using a Subquery (Compatible with Older SQL Versions):
SELECT category_id, SUM(sales_amount) AS category_sales, (SUM(sales_amount) * 100.0) / (SELECT SUM(sales_amount) FROM sales) AS sales_percentage FROM sales GROUP BY category_id;
This works the same way but calculates total sales in a subquery.
Top 20 SQL Interview Questions
Like this post if you want me to continue this SQL Interview Series♥️
Share with credits: https://t.me/sqlspecialist
Hope it helps :)
Вже доступно! Дослідження Telegram за 2025 — головні інсайти року 
