SQL Programming Resources
Find top SQL resources from global universities, cool projects, and learning materials for data analytics. Admin: @coderfun Useful links: heylink.me/DataAnalytics Promotions: @love_data
Ko'proq ko'rsatish📈 Telegram kanali SQL Programming Resources analitikasi
SQL Programming Resources (@sqlanalyst) Ingliz til segmentidagi kanali faol ishtirokchi. Hozirda hamjamiyat 76 536 obunachidan iborat bo'lib, Texnologiyalar & Aralashmalar toifasida 1 677-o'rinni va Hindiston mintaqasida 4 007-o'rinni egallagan.
📊 Auditoriya ko‘rsatkichlari va dinamika
невідомо sanasidan buyon loyiha tez o‘sib, 76 536 obunachiga ega bo‘ldi.
25 Oktabr, 2026 dagi oxirgi ma’lumotlarga ko‘ra kanal barqaror faollikka ega. Oxirgi 30 kunda obunachilar soni -171 ga, so‘nggi 24 soatda esa -10 ga o‘zgardi va umumiy qamrov yuqori darajada qolmoqda.
- Tasdiqlash holati: Tasdiqlanmagan
- Jalb etish (ER): Auditoriya o‘rtacha 2.69% darajada jalb etiladi. Nashrdan keyingi dastlabki 24 soatda kontent odatda umumiy obunachilar sonining 1.02% ini tashkil etuvchi reaksiyalarni to‘playdi.
- Post qamrovi: Har bir post o‘rtacha 2 062 marta ko‘riladi; birinchi sutkada odatda 779 ta ko‘rish yig‘iladi.
- Reaksiyalar va o‘zaro ta’sir: Auditoriya faol: har bir postga o‘rtacha 5 ta reaksiya keladi.
- Tematik yo‘nalishlar: Kontent row, sql, customer_id, logic, desc kabi asosiy mavzularga jamlangan.
📝 Tavsif va kontent siyosati
Muallif resursni shaxsiy fikrni ifoda etish maydoni sifatida ta’riflaydi:
“Find top SQL resources from global universities, cool projects, and learning materials for data analytics.
Admin: @coderfun
Useful links: heylink.me/DataAnalytics
Promotions: @love_data”
Yuqori yangilanish chastotasi (oxirgi ma’lumot 26 Oktabr, 2026 da olingan) sababli kanal doimo dolzarb va katta qamrovli bo‘lib qoladi. Analitika auditoriya kontent bilan faol hamkorlik qilishini, uni Texnologiyalar & Aralashmalar toifasidagi muhim ta’sir nuqtasiga aylantirishini ko‘rsatadi.
employee_id | employee_name | department | salary
------------|---------------|------------|-------
1 | Amit | IT | 50000
2 | Rahul | IT | 80000
3 | Priya | HR | 60000
4 | Neha | HR | 90000
5 | Raj | Finance | 70000
❓ Find all employees whose salary is greater than the average salary of the entire company.
💡 Approach
First, calculate the average salary across all employees.
Then compare every employee's salary with that average.
Company average:
(50000 + 80000 + 60000 + 90000 + 70000) / 5
= 70000
Employees earning more than 70000:
Rahul → 80000
Neha → 90000
📌 SQL Solution
SELECT
employee_id,
employee_name,
department,
salary
FROM Employee
WHERE salary > (
SELECT AVG(salary)
FROM Employee
);
🔎 How does it work?
The subquery:
SELECT AVG(salary)
FROM Employee;
calculates the company-wide average:
70000
The outer query then checks:
WHERE salary > 70000
and returns only employees earning above that amount.
📌 Expected Result:
employee_name | department | salary
--------------|------------|-------
Rahul | IT | 80000
Neha | HR | 90000
Double Tap ❤️ For More
-----
1.33 ₽ · /balance_helpemployee_id | employee_name | department | salary
------------|---------------|------------|-------
1 | Amit | IT | 60000
2 | Rahul | IT | 80000
3 | Priya | HR | 70000
4 | Neha | HR | 90000
5 | Raj | Finance | 85000
6 | Karan | Finance | 95000
❓ Find the department that has the highest average salary.
💡 Approach
First, calculate the average salary for every department.
Then, find the department with the highest average.
Department averages:
IT → (60000 + 80000) / 2 = 70000
HR → (70000 + 90000) / 2 = 80000
Finance → (85000 + 95000) / 2 = 90000
Therefore:
Finance → 90000
📌 SQL Solution
SELECT
department,
AVG(salary) AS avg_salary
FROM Employee
GROUP BY department
ORDER BY avg_salary DESC
LIMIT 1;
Expected result:
department | avg_salary
-----------|-----------
Finance | 90000
🔎 How does it work?
1️⃣ "GROUP BY department"
Creates one group for each department.
2️⃣ "AVG(salary)"
Calculates the average salary within each department.
3️⃣ "ORDER BY avg_salary DESC"
Places the department with the highest average first.
4️⃣ "LIMIT 1"
Returns only the top department.
⚠️ Interview Trap
What if two departments have the same highest average salary?
For example:
IT → 80000
HR → 80000
Finance → 75000
"LIMIT 1" would return only one department.
If the interviewer asks:
👉 "Find all departments having the highest average salary"
then use a ranking approach:
SELECT department, avg_salary
FROM (
SELECT
department,
AVG(salary) AS avg_salary,
DENSE_RANK() OVER (
ORDER BY AVG(salary) DESC
) AS rnk
FROM Employee
GROUP BY department
) d
WHERE rnk = 1;
Now both IT and HR would be returned.
🎯 Double Tap ❤️ For More
-----
1.3 ₽ · /balance_helpsale_id | sale_date | amount
--------|------------|-------
1 | 2026-01-01 | 1000
2 | 2026-01-02 | 1500
3 | 2026-01-03 | 800
4 | 2026-01-04 | 1200
❓ Calculate the cumulative (running) sales amount for each day.
💡 Approach
A running total means:
Current day's sales + all previous sales
For example:
1000
1000 + 1500 = 2500
2500 + 800 = 3300
3300 + 1200 = 4500
The easiest approach is to use the "SUM()" window function.
📌 SQL Solution
SELECT
sale_date,
amount,
SUM(amount) OVER (
ORDER BY sale_date
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
) AS running_total
FROM Sales
ORDER BY sale_date;
🔎 How does it work?
1️⃣ "ORDER BY sale_date"
Determines the order in which the running total is calculated.
2️⃣ "SUM(amount) OVER(...)"
Calculates the sum without collapsing the rows like a normal "GROUP BY".
3️⃣ "UNBOUNDED PRECEDING"
Means:
Start from the first row.
4️⃣ "CURRENT ROW"
Means:
Include the current row in the total.
So the calculation becomes:
Date Amount Running Total
---------- -------- -------------
Jan 01 1000 1000
Jan 02 1500 2500
Jan 03 800 3300
Jan 04 1200 4500
⚠️ Interview Trap
Don't use:
GROUP BY sale_date
for a running total.
"GROUP BY" collapses rows into groups.
A window function allows us to calculate an aggregate while keeping individual rows.
Also, if multiple rows can have the same "sale_date", be careful about the ordering. A unique column such as "sale_id" may need to be included:
SUM(amount) OVER (
ORDER BY sale_date, sale_id
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
)
🎯 Double Tap ❤️ For More
-----
1.31 ₽ · /balance_help