Data Science & Machine Learning
Join this channel to learn data science, artificial intelligence and machine learning with funny quizzes, interesting projects and amazing resources for free For collaborations: @love_data
Mostrar más📈 Análisis del canal de Telegram Data Science & Machine Learning
El canal Data Science & Machine Learning (@datasciencefun) en el segmento lingüístico de Inglés es un actor destacado. Actualmente la comunidad reúne a 77 741 suscriptores, ocupando la posición 2 010 en la categoría Educación y el puesto 3 917 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 77 741 suscriptores.
Según los últimos datos del 25 octubre, 2026, el canal mantiene una actividad estable. En los últimos 30 días la variación de miembros fue de 175, y en las últimas 24 horas de 0, conservando un alto alcance.
- Estado de verificación: No verificado
- Tasa de interacción (ER): El promedio de interacción de la audiencia es 2.75%. Durante las primeras 24 horas tras publicar, el contenido suele obtener 1.13% de reacciones respecto al total de suscriptores.
- Alcance de las publicaciones: Cada publicación recibe en promedio 2 139 visualizaciones. En el primer día suele acumular 882 visualizaciones.
- Reacciones e interacción: La audiencia responde de forma activa: el promedio de reacciones por publicación es 3.
- Intereses temáticos: El contenido se centra en temas clave como learning, accuracy, distribution, panda, dataset.
📝 Descripción y política de contenido
El autor describe el recurso como un espacio para expresar opiniones subjetivas:
“Join this channel to learn data science, artificial intelligence and machine learning with funny quizzes, interesting projects and amazing resources for free
For collaborations: @love_data”
Gracias a la alta frecuencia de actualizaciones (últimos datos recibidos el 26 octubre, 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 Educación.
SELECT category,
SUM(quantity * price) AS total_revenue
FROM sales
GROUP BY category
ORDER BY total_revenue DESC;
This gives you a category-level summary that can be used for:
• Revenue analysis
• Product performance
• Business reporting
• Feature creation
• Exploratory data analysis
🔹 Common Mistake
Consider:
SELECT department, employee_name, AVG(salary)
FROM employees
GROUP BY department;
This can cause an error in many SQL databases because employee_name is neither:
• included in GROUP BY, nor
• used inside an aggregate function.
A valid query would be:
SELECT department, AVG(salary)
FROM employees
GROUP BY department;
🔹 Important Rule
When using GROUP BY, selected columns generally need to be either:
1. Included in the GROUP BY, or
2. Wrapped inside an aggregate function.
Example:
SELECT department, COUNT(*)
FROM employees
GROUP BY department;
department → grouped column
COUNT(*) → aggregate
🔹 Interview Questions
1. What is GROUP BY?
GROUP BY groups rows with the same values so aggregate calculations can be performed for each group.
2. Which aggregate functions are commonly used with GROUP BY?
COUNT(), SUM(), AVG(), MIN(), and MAX().
3. What is the difference between WHERE and GROUP BY?
WHERE filters individual rows before grouping.
GROUP BY creates groups from the filtered rows.
4. Can GROUP BY use multiple columns?
Yes.
GROUP BY department, job_title;
5. Can GROUP BY be used without aggregate functions?
Yes, although DISTINCT is often clearer when the goal is simply to return unique combinations.
🎯 Practice Questions
1. Find the number of employees in each department.
2. Find the average salary for each department.
3. Find the total sales for each region.
4. Find the highest salary in each department.
5. Find the total revenue for each product category and sort categories from highest to lowest revenue.
🎯 Key Takeaways
• GROUP BY creates groups of similar rows.
• It is commonly used with aggregate functions.
• COUNT() counts.
• SUM() totals.
• AVG() calculates averages.
• MIN() finds the minimum.
• MAX() finds the maximum.
• WHERE filters rows before grouping.
• ORDER BY can sort grouped results.
• GROUP BY is one of the most important SQL concepts for Data Science and Analytics.
📍Double Tap ❤️ For More
-----
1.34 ₽ · /balance_helpSELECT column_name, aggregate_function(column_name)
FROM table_name
GROUP BY column_name;
Common aggregate functions:
• COUNT() → Count rows
• SUM() → Calculate total
• AVG() → Calculate average
• MIN() → Find minimum
• MAX() → Find maximum
🔹 Simple Example
Suppose we have:
department salary
IT 60000
IT 80000
HR 50000
HR 70000
Finance 90000
Query:
SELECT department, AVG(salary) AS avg_salary
FROM employees
GROUP BY department;
Result:
department avg_salary
IT 70000
HR 60000
Finance 90000
Instead of calculating one overall average, SQL calculates an average for each department.
🔹 GROUP BY with COUNT()
To count employees in each department:
SELECT department, COUNT(*) AS employee_count
FROM employees
GROUP BY department;
Result:
department employee_count
IT 2
HR 2
Finance 1
🔹 GROUP BY with SUM()
Suppose you have sales data:
region sales
North 10000
North 15000
South 20000
South 12000
Query:
SELECT region, SUM(sales) AS total_sales
FROM sales
GROUP BY region;
Result:
North 25000
South 32000
This is extremely common in business analytics.
🔹 GROUP BY with MAX()
Find the highest salary in each department:
SELECT department, MAX(salary) AS highest_salary
FROM employees
GROUP BY department;
🔹 GROUP BY with MIN()
Find the lowest salary in each department:
SELECT department, MIN(salary) AS lowest_salary
FROM employees
GROUP BY department;
🔹 GROUP BY with Multiple Columns
You can group by multiple columns.
SELECT department, job_title, COUNT(*) AS employee_count
FROM employees
GROUP BY department, job_title;
Here SQL creates groups based on:
department + job_title
For example:
IT Analyst 5
IT Developer 8
HR Analyst 3
Finance Manager 4
🔹 GROUP BY with WHERE
WHERE filters rows before grouping.
SELECT department, AVG(salary) AS avg_salary
FROM employees
WHERE salary > 50000
GROUP BY department;
🔹 GROUP BY with ORDER BY
You can sort grouped results.
For example, find departments with the highest total salary first:
SELECT department, SUM(salary) AS total_salary
FROM employees
GROUP BY department
ORDER BY total_salary DESC;
This is very useful for ranking groups.
🔹 GROUP BY vs DISTINCT
These two can sometimes look similar.
DISTINCT
SELECT DISTINCT department
FROM employees;
Used to find unique departments.
GROUP BY
SELECT department, COUNT(*)
FROM employees
GROUP BY department;ORDER BY salary DESC
LIMIT 5;
Mistake 3 — Forgetting that LIMIT applies after sorting
For a top-N analysis, think:
ORDER BY → LIMIT
not simply:
LIMIT → assume top records
🔹 Interview Questions
1. What is LIMIT?
LIMIT restricts the number of rows returned by a query.
2. How do you find the top 10 salaries?
SELECT *
FROM employees
ORDER BY salary DESC
LIMIT 10;
3. Can LIMIT be used with WHERE?
Yes.
SELECT *
FROM employees
WHERE department = 'Finance'
LIMIT 5;
4. Why is ORDER BY important when using LIMIT?
Because without sorting, the returned rows are not necessarily the highest, lowest, newest, or oldest records you want.
5. What is OFFSET used for?
OFFSET skips a specified number of rows before returning the requested rows, commonly for pagination.
🎯 Double Tap ❤️ For More
-----
1.31 ₽ · /balance_helpSELECT *
FROM employees
LIMIT 5;
This returns only 5 rows from the result.
🔹 LIMIT with ORDER BY
This is where LIMIT becomes especially powerful.
Suppose you want the 5 highest-paid employees:
SELECT employee_name, salary
FROM employees
ORDER BY salary DESC
LIMIT 5;
The logical idea is:
Filter → Sort → Take required number of rows
For example:
Salary
120000
110000
95000
90000
85000
Only the top 5 rows are returned.
🔹 LIMIT Without ORDER BY
You can write:
SELECT *
FROM employees
LIMIT 5;
But without ORDER BY, you should not assume these are the "first" or "top" 5 meaningful records.
The database does not guarantee a particular order unless you explicitly specify one.
So for analysis, this is usually better:
SELECT *
FROM employees
ORDER BY salary DESC
LIMIT 5;
🔹 LIMIT with WHERE
You can combine WHERE, ORDER BY, and LIMIT.
Example:
SELECT employee_name, salary
FROM employees
WHERE department = 'IT'
ORDER BY salary DESC
LIMIT 3;
This finds the 3 highest-paid employees in the IT department.
🔹 LIMIT for Top-N Analysis
Top-N queries are extremely common in data analysis.
Top 10 products by sales
SELECT product_name, sales
FROM products
ORDER BY sales DESC
LIMIT 10;
5 most recent transactions
SELECT transaction_id, transaction_date, amount
FROM transactions
ORDER BY transaction_date DESC
LIMIT 5;
3 cheapest products
SELECT product_name, price
FROM products
ORDER BY price ASC
LIMIT 3;
🔹 LIMIT with OFFSET
OFFSET allows you to skip a certain number of rows before returning results.
Example:
SELECT *
FROM employees
LIMIT 5 OFFSET 10;
This means:
Skip 10 rows
↓
Return the next 5 rows
This is commonly used for pagination.
For example:
• Page 1 → LIMIT 10 OFFSET 0
• Page 2 → LIMIT 10 OFFSET 10
• Page 3 → LIMIT 10 OFFSET 20
Syntax can vary between SQL databases, so always check the specific database you are using.
🔹 LIMIT vs TOP vs FETCH
Different SQL databases may use different syntax.
MySQL/PostgreSQL/SQLite commonly use:
LIMIT 5;
SQL Server commonly uses:
SELECT TOP 5 *
FROM employees;
Standard SQL also supports:
FETCH FIRST 5 ROWS ONLY;
The concept is the same: restrict the number of returned rows.
🔹 Real-World Data Science Example
Suppose an analyst wants to investigate the 10 largest customer transactions.
SELECT customer_id,
transaction_id,
amount
FROM transactions
ORDER BY amount DESC
LIMIT 10;
This can help identify:
• High-value transactions
• Potential anomalies
• Important customers
• Transactions requiring further investigation
🔹 Common Mistakes
Mistake 1 — Using LIMIT without sorting
SELECT *
FROM products
LIMIT 10;
This does not necessarily mean "10 best products."
For that:
ORDER BY sales DESC
LIMIT 10;
Mistake 2 — Using ASC when you need the highest values
Wrong:
ORDER BY salary ASC
LIMIT 5;
This returns the lowest salaries.
For the highest salaries:SELECT customer_id, product_id, quantity, price,
quantity * price AS transaction_value
FROM sales
ORDER BY transaction_value DESC;
This can help with:
• Finding high-value transactions
• Identifying important customers
• Investigating unusually large purchases
• Preparing data for further analysis
🔹 Common Mistakes
Mistake 1 — Forgetting DESC
If you want the highest salary first: ORDER BY salary DESC; Not ORDER BY salary;
Mistake 2 — Wrong column
Make sure the column used for sorting actually represents what you want to analyze.
Mistake 3 — Incorrect multiple-column ordering
ORDER BY department, salary DESC; does NOT mean both columns are descending. It means: department → ASC, salary → DESC
If you want both descending: ORDER BY department DESC, salary DESC;
Mistake 4 — Confusing WHERE and ORDER BY
WHERE filters rows. ORDER BY sorts rows. They perform different jobs.
🔹 Interview Questions
1. What is ORDER BY?
ORDER BY sorts query results based on one or more columns.
2. What is the default sorting order?
Ascending order (ASC) is generally the default.
3. How do you find the highest salary?
SELECT * FROM employees ORDER BY salary DESC;
4. Can you sort using multiple columns?
Yes. ORDER BY department ASC, salary DESC;
5. What is the difference between ASC and DESC?
ASC sorts from low to high or A–Z. DESC sorts from high to low or Z–A.
🎯 Practice Questions
1. Write a query to display all products from the cheapest to the most expensive.
2. Write a query to display employees from the highest salary to the lowest salary.
3. Write a query to display customers alphabetically by name.
4. Write a query to sort sales by date, showing the newest sales first.
5. Write a query to sort employees by department alphabetically and salary from highest to lowest within each department.
🎯 Key Takeaways
• ORDER BY sorts query results
• ASC means ascending
• DESC means descending
• Ascending is generally the default
• You can sort numbers, text and dates
• You can sort using multiple columns
• WHERE filters data; ORDER BY sorts data
• ORDER BY is especially useful when analyzing rankings and top/bottom records
👉 Double Tap ❤️ For More
-----
1.16 ₽ · /balance_help