HomeInterview QuestionsWhat will be the result of the query?

What will be the result of the query?

🟢 Easy Conceptual Junior level
1Times asked
May 2026Last seen
May 2026First seen

💡 Model Answer

The query will return the aggregated metrics: total salary, average salary, highest salary, lowest salary, and optionally a breakdown by city. For example, if you run SELECT SUM(Salary) AS total_salary, AVG(Salary) AS avg_salary, MAX(Salary) AS max_salary, MIN(Salary) AS min_salary FROM customers; you will get the total salary of 41,869,312, an average of 10,467,328, a maximum of 39,482,309, and a minimum of 34,234. If you add a GROUP BY clause on City_Name, you will see the same metrics per city: Pune has a total of 2,352,769 and an average of 1,176,384.5, Patana has 39,482,309, and Mumbai has 34,234. The query can be extended to include additional columns such as customer_name or to filter by specific criteria. The result set will be a single row for the overall metrics or multiple rows if grouped by city. If you need the result in a specific format, such as JSON or CSV, you can use the appropriate export functions in your database client. The query is straightforward and can be executed in any SQL environment that supports aggregate functions. You can also add a HAVING clause to filter out cities with a total salary below a certain threshold, or use window functions to rank customers by salary.

This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.

🎤 Get questions like this answered in real-time

Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers on a discreet on-screen overlay.

Get Assisting AI — Starts at ₹500