TGViewer
Data Analytics Data Analytics @sqlspecialist · 111K subscribers
Post #2607 8K
✅ SQL Aggregate Functions Practice Questions with Answers 🧠📊

🔎 Q1. Find the total salary of all employees.
🗂️ Table: "employees(emp_id, name, salary)"

✅ Answer:
SELECT SUM(salary) AS total_salary
FROM employees;

 

🔎 Q2. Calculate the average salary of employees.
🗂️ Table: "employees(emp_id, name, salary)"

✅ Answer:
SELECT AVG(salary) AS avg_salary
FROM employees;

 

🔎 Q3. Count total number of employees in the company.
🗂️ Table: "employees(emp_id, name)"

✅ Answer:
SELECT COUNT(*) AS total_employees
FROM employees;

 

🔎 Q4. Find the highest and lowest salary.
🗂️ Table: "employees(emp_id, name, salary)"

✅ Answer:
SELECT MAX(salary) AS highest_salary,
MIN(salary) AS lowest_salary
FROM employees;

 

🔎 Q5. Get total salary paid in each department.
🗂️ Table: "employees(emp_id, name, department_id, salary)"

✅ Answer:
SELECT department_id,
SUM(salary) AS total_salary
FROM employees
GROUP BY department_id;

Double Tap ♥️ For More
  • ❤ 38
More from @sqlspecialist
  1. Oct 9, 2026“Here, the data is sorted by the second column in descending order and the first five rows…
  2. Oct 9, 2026📊 Data Analyst Interview Series — Part 6 Guys, let's continue our Data Analyst Interview…
  3. Oct 9, 2026🇮🇳 𝗚𝗢𝗩𝗘𝗥𝗡𝗠𝗘𝗡𝗧 𝗢𝗙 𝗜𝗡𝗗𝗜𝗔 — 𝗔𝗜𝗖𝗧𝗘 𝗜𝗡𝗧𝗘𝗥𝗡𝗦𝗛𝗜𝗣𝗦 𝟮𝟬𝟮𝟲 🚀…
  4. Oct 8, 2026🎓 𝗠𝗶𝗰𝗿𝗼𝘀𝗼𝗳𝘁 𝗙𝗥𝗘𝗘 𝗖𝗼𝘂𝗿𝘀𝗲𝘀 𝘄𝗶𝘁𝗵 𝗖𝗲𝗿𝘁𝗶𝗳𝗶𝗰𝗮𝘁𝗲𝘀! 🚀🔥 Upgr…
  5. Oct 7, 2026📊 Kandinsky 6.0 Video: AI-Powered Content Creation for Analysts The new Kandinsky 6.0 Vid…
  6. Oct 7, 2026Alternatively, depending on the Excel version and requirement, I could use functions such…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →