Data Analytics
Perfect channel to learn Data Analytics Learn SQL, Python, Alteryx, Tableau, Power BI and many more For Promotions: @coderfun @love_data
Mostrar más📈 Análisis del canal de Telegram Data Analytics
El canal Data Analytics (@sqlspecialist) en el segmento lingüístico de Inglés es un actor destacado. Actualmente la comunidad reúne a 109 615 suscriptores, ocupando la posición 1 126 en la categoría Tecnologías y Aplicaciones y el puesto 2 380 en la región India.
📊 Métricas de audiencia y dinámica
Desde su creación el невідомо, el proyecto ha mostrado un crecimiento acelerado, reuniendo a 109 615 suscriptores.
Según los últimos datos del 18 junio, 2026, el canal mantiene una actividad estable. En los últimos 30 días la variación de miembros fue de 686, y en las últimas 24 horas de -13, conservando un alto alcance.
- Estado de verificación: No verificado
- Tasa de interacción (ER): El promedio de interacción de la audiencia es 3.27%. Durante las primeras 24 horas tras publicar, el contenido suele obtener 1.44% de reacciones respecto al total de suscriptores.
- Alcance de las publicaciones: Cada publicación recibe en promedio 3 581 visualizaciones. En el primer día suele acumular 1 584 visualizaciones.
- Reacciones e interacción: La audiencia responde de forma activa: el promedio de reacciones por publicación es 8.
- Intereses temáticos: El contenido se centra en temas clave como row, sql, analytic, analyst, visualization.
📝 Descripción y política de contenido
El autor describe el recurso como un espacio para expresar opiniones subjetivas:
“Perfect channel to learn Data Analytics
Learn SQL, Python, Alteryx, Tableau, Power BI and many more
For Promotions: @coderfun @love_data”
Gracias a la alta frecuencia de actualizaciones (últimos datos recibidos el 19 junio, 2026), el canal mantiene la vigencia y un amplio alcance. La analítica demuestra que la audiencia interactúa activamente con el contenido, lo que lo convierte en un punto de referencia dentro de la categoría Tecnologías y Aplicaciones.
SELECT * FROM products WHERE price BETWEEN 100 AND 500;
44. What is a pivot table in SQL?
A pivot table transforms rows into columns, which is helpful for summarizing data.
It can be created using GROUP BY, CASE statements, or database-specific PIVOT keywords.
Example: Monthly sales data pivoted by region.
45. How do you optimize SQL queries?
To optimize SQL queries, consider the following strategies:
• Use indexes effectively on frequently queried columns.
• Avoid using SELECT *; specify only the needed columns.
• Use WHERE clauses to filter data as early as possible.
• Prefer EXISTS over IN for subqueries to improve performance.
• Analyze execution plans to identify bottlenecks.
• Avoid unnecessary joins or deeply nested subqueries.
46. How do you handle slow queries?
To address slow queries, you can:
• Check and optimize indexes on columns used in filters.
• Break large queries into smaller, more manageable parts.
• Implement caching strategies to reduce load times.
• Limit the number of returned rows using LIMIT or TOP clauses.
• Use EXPLAIN or QUERY PLAN to analyze and diagnose performance issues.
47. What’s the use of execution plan in SQL?
An execution plan illustrates how the database engine will execute a given query.
It helps identify slow operations (like full table scans) and suggests areas for optimization.
You can view execution plans using EXPLAIN in MySQL/PostgreSQL or SET SHOWPLAN_ALL in SQL Server.
48. What’s the use of LIMIT / OFFSET?
• LIMIT: Restricts the number of rows returned by a query.
• OFFSET: Skips a specified number of rows before starting to return results.
Example:
SELECT * FROM users LIMIT 10 OFFSET 20;
This is particularly useful for implementing pagination.
49. How do you import/export data in SQL?
• Importing Data: Use commands like LOAD DATA INFILE, BULK INSERT, or utilize import tools provided by database management systems.
• Exporting Data: Use SELECT INTO OUTFILE, mysqldump, pg_dump, or export data to CSV from GUI tools.
50. How would you clean messy data using SQL?
To clean messy data, you can apply several functions:
• Use TRIM() to remove leading and trailing spaces.
• Use REPLACE() to eliminate unwanted characters or strings.
• Handle NULL values with COALESCE() to provide default values.
• Use CASE statements for conditional transformations of data.
• Utilize subqueries or Common Table Expressions (CTEs) to identify and remove duplicates or invalid entries.
💡 Double Tap ♥️ For MoreSELECT name FROM users WHERE email IS NULL;
22. What is COALESCE() in SQL?
It returns the first non-NULL value from a list.
SELECT COALESCE(phone, 'Not Provided') FROM customers;
23. What are aggregate functions? 📊
Functions that perform calculations on multiple rows:
- COUNT()
- SUM()
- AVG()
- MAX()
- MIN()
24. What is GROUP BY and how does it work?
It groups rows that have the same values and is used with aggregate functions.
SELECT department, COUNT(*) FROM employees GROUP BY department;
25. What is the difference between COUNT(\*) and COUNT(column)?
- COUNT(\*): Counts all rows, including those with NULLs.
- COUNT(column): Counts non-NULL values in that column.
26. What are window functions? 🪟
They perform calculations across rows related to the current row without collapsing results.
Examples: ROW_NUMBER(), RANK(), SUM() OVER()
27. Difference between RANK(), DENSE_RANK(), and ROW_NUMBER()
- RANK(): Skips ranks on ties (1, 1, 3)
- DENSE_RANK(): No gaps in ranking (1, 1, 2)
- ROW_NUMBER(): Unique sequence for each row (1, 2, 3)
28. What is the use of LAG() and LEAD()?
They access previous (LAG) or next (LEAD) row values in the result set.
SELECT name, salary, LAG(salary) OVER (ORDER BY id) AS prev_salary FROM employees;
29. What is a CASE statement?
It's used for conditional logic in queries.
SELECT name,
CASE
WHEN salary > 5000 THEN 'High'
ELSE 'Low'
END AS salary_level
FROM employees;
30. What is the difference between CHAR and VARCHAR?
- CHAR(n): Fixed-length, always reserves n characters. (Padding with spaces if shorter)
- VARCHAR(n): Variable-length, uses space based on actual content. (More efficient for varying lengths)
💬 Double Tap ❤️ For Part-4SELECT DISTINCT * FROM table_name;
Or:sql
WITH Ranked AS (
SELECT *, ROW_NUMBER() OVER (PARTITION BY col1, col2 ORDER BY id) AS rn
FROM table_name
)
DELETE FROM Ranked WHERE rn > 1;
12. What is normalization? Explain its types. 🧱
Normalization reduces redundancy and improves data integrity.
- 1NF: Atomic columns (no repeating groups)
- 2NF: 1NF + no partial dependency
- 3NF: 2NF + no transitive dependency
- BCNF: Advanced version of 3NF
13. What is denormalization?
The process of combining tables to improve read speed by introducing redundancy. Used for reporting and faster queries. ⚡
14. What is a stored procedure?
A saved set of SQL statements that can be reused. 💾
CREATE PROCEDURE GetUsers AS
BEGIN
SELECT * FROM users;
END;
15. What are indexes and why are they used?
Indexes speed up query performance by allowing quick data lookup. Useful on columns used in WHERE or JOIN clauses. 🏎️
16. What is the difference between clustered and non-clustered index?
- Clustered: Sorts actual table data. Only one per table. (Physical Order)
- Non-clustered: Separate structure that references data. Can have many. (Logical Order)
17. What is a transaction?
A group of operations treated as a single unit. It follows ACID principles to maintain data integrity.
18. ACID properties in SQL
- Atomicity: All or none of the operations run (All-or-Nothing)
- Consistency: Data stays valid before/after transaction ⚖️
- Isolation: Transactions don’t interfere 🧍
- Durability: Changes remain after success ✅
19. Difference between DELETE, TRUNCATE, and DROP
- DELETE: Removes rows, can be rolled back (logged). ⏪
- TRUNCATE: Removes all rows, faster, less logging. 🗑️
- DROP: Deletes table structure and data entirely. 💥
20. What is a NULL value in SQL?
NULL represents missing or unknown data. It's different from 0 or an empty string. (Unknown, not Zero.)
💬 Double Tap ❤️ For Part-3WITH cte_name AS (
SELECT ...
)
SELECT * FROM cte_name;
10. What is a view in SQL?
A view is a virtual table based on a SQL query. It doesn't store data itself but provides a way to simplify complex queries, improve security, and reuse logic.
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!SELECT name
FROM employees
WHERE salary > (SELECT AVG(salary) FROM employees);
📌 Use case: Find employees earning above average.
Types:
⦁ In SELECT
⦁ In WHERE
⦁ In FROM (Inline Views)
2️⃣ Correlated Subqueries
Inner query depends on outer query.
Example:
SELECT name
FROM employees e
WHERE salary > (SELECT AVG(salary) FROM employees WHERE dept_id = e.dept_id);
📌 Use case: Find employees earning above average in their department.
3️⃣ Common Table Expressions (CTE)
Temporary result set using WITH. Improves readability.
Example:
WITH high_paid AS (
SELECT name, salary FROM employees WHERE salary > 100000
)
SELECT * FROM high_paid;
📌 Use case: Simplify complex queries, recursive queries.
4️⃣ Recursive CTE
Used for hierarchical data (e.g. org charts, folders).
Example:
WITH RECURSIVE emp_tree AS (
SELECT id, name, manager_id FROM employees WHERE manager_id IS NULL
UNION ALL
SELECT e.id, e.name, e.manager_id
FROM employees e
JOIN emp_tree et ON e.manager_id = et.id
)
SELECT * FROM emp_tree;
🧠 Interview Questions
Q1: When should you use a subquery vs JOIN?
A: Use subquery when working with aggregates or filtering logic. JOINs are better for combining related data.
Q2: What's the difference between subquery and CTE?
A: Subquery is inline; CTE improves readability and can be reused in the query.
Q3: What is a correlated subquery?
A: It depends on data from the outer query. Runs row by row.
Q4: When do you use recursive CTEs?
A: For hierarchical/parent-child relationships like org charts, file systems.
Q5: Can subqueries be used in the FROM clause?
A: Yes, they're called derived tables or inline views.
💬 Double Tap ❤️ for more!SELECT COUNT(*) FROM employees;
2️⃣ SUM()
Adds up values in a column.
SELECT dept_id, SUM(salary)
FROM employees
GROUP BY dept_id;
3️⃣ AVG()
Returns the average of values.
SELECT AVG(salary) FROM employees;
4️⃣ MAX() / MIN()
Returns the highest/lowest value.
SELECT MAX(salary), MIN(salary) FROM employees;
5️⃣ GROUP BY
Groups rows that have the same values in specified columns.
SELECT dept_id, COUNT(*)
FROM employees
GROUP BY dept_id;
6️⃣ HAVING
Filters groups after aggregation (unlike WHERE which filters rows).
SELECT dept_id, AVG(salary)
FROM employees
GROUP BY dept_id
HAVING AVG(salary) > 50000;
————————
Real-World Interview Questions + Answers
Q1: What’s the difference between WHERE and HAVING?
A: WHERE filters rows before grouping. HAVING filters after aggregation.
Q2: Can you use aggregate functions without GROUP BY?
A: Yes. Without GROUP BY, the function applies to the entire table.
Q3: How do you find departments with more than 5 employees?
SELECT dept_id, COUNT(*)
FROM employees
GROUP BY dept_id
HAVING COUNT(*) > 5;
Q4: Can you group by multiple columns?
A: Yes.
GROUP BY dept_id, job_title
Q5: How do you calculate total and average salary per department?
SELECT dept_id, SUM(salary), AVG(salary)
FROM employees
GROUP BY dept_id;
💬 Tap ❤️ for more!SELECT e.name, d.department_name
FROM employees e
INNER JOIN departments d ON e.dept_id = d.id;
Use: Employee names with their departments.
2️⃣ LEFT JOIN (LEFT OUTER JOIN)
All left table rows + matching right; NULLs for no match.
SELECT e.name, d.department_name
FROM employees e
LEFT JOIN departments d ON e.dept_id = d.id;
Use: All employees, even without departments.
3️⃣ RIGHT JOIN (RIGHT OUTER JOIN)
All right table rows + matching left.
SELECT e.name, d.department_name
FROM employees e
RIGHT JOIN departments d ON e.dept_id = d.id;
Use: All departments, even empty ones.
4️⃣ FULL OUTER JOIN
All rows from both; NULLs where no match (PostgreSQL/MySQL supports).
SELECT e.name, d.department_name
FROM employees e
FULL OUTER JOIN departments d ON e.dept_id = d.id;
Use: Spot unmatched records.
5️⃣ SELF JOIN
Table joins itself.
SELECT a.name AS Employee, b.name AS Manager
FROM employees a
JOIN employees b ON a.manager_id = b.id;
Use: Employee-manager hierarchy.
Real-World Interview Questions + Answers
Q1: What is the difference between INNER and OUTER JOIN?
A: INNER returns only matches; OUTER includes unmatched from one/both tables.
Q2: When would you use LEFT JOIN instead of INNER JOIN?
A: To keep all left table rows, even without right matches.
Q3: How can you find employees who don’t belong to any department?
A: LEFT JOIN + IS NULL filter.
SELECT e.name
FROM employees e
LEFT JOIN departments d ON e.dept_id = d.id
WHERE d.department_name IS NULL;
Q4: How would you find mismatched data between two tables?
A: FULL OUTER JOIN + IS NULL on either side.
Q5: Can you join more than two tables?
A: Yes, chain JOINs: FROM A JOIN B ON... JOIN C ON...
These cover core joins from 2025 interview prep like Verve Copilot and DataCamp—INNER is most common, but know when to go OUTER for complete views.
💬 Tap ❤️ for more!SELECT name, age FROM employees WHERE age > 30;
This shows names and ages of employees older than 30.
2️⃣ ORDER BY, LIMIT
Use when you want sorted results or only a few records.
👉 ORDER BY sorts data
👉 LIMIT reduces how many rows you get
Example:
SELECT name, salary FROM employees ORDER BY salary DESC LIMIT 3;
Shows top 3 highest paid employees.
3️⃣ DISTINCT
Removes duplicate values from a column.
Example:
SELECT DISTINCT department FROM employees;
Lists all unique departments from the employees table.
4️⃣ BETWEEN
Used for filtering within a range (numbers, dates, etc).
Example:
SELECT name FROM employees WHERE age BETWEEN 25 AND 35;
Shows names of employees aged 25 to 35.
5️⃣ IN
Use IN to match against multiple values in one go.
Example:
SELECT name FROM employees WHERE department IN ('HR', 'Sales');
Shows names of people working in HR or Sales.
6️⃣ LIKE
Used to match text patterns.
👉 % = wildcard (any text)
Example:
SELECT name FROM employees WHERE name LIKE 'A%';
Finds names starting with A.
💬 Double Tap ❤️ if this helped you!ORDER BY with LIMIT or OFFSET, or a subquery.
MySQL / PostgreSQL (with LIMIT & OFFSET):
SELECT salary
FROM employees
ORDER BY salary DESC
LIMIT 1 OFFSET 1;
Using Subquery (Works on most databases):
SELECT MAX(salary)
FROM employees
WHERE salary < (SELECT MAX(salary) FROM employees);
🧠 Logic Breakdown:
- First method sorts and skips the top result
- Second method finds the highest salary below the max
💡 Tip: Use DENSE_RANK() if multiple employees share the same salary rank
💬 Tap ❤️ for more!
¡Ya disponible! Investigación de Telegram 2025 — los principales insights del año 
