Question
What is the result of the following SQL query?
 SELECT department, COUNT (employee_id) FROM employees GROUPBY department HAVING COUNT (employee_id) > 5 ;Solution
Explanation: This query groups employee data by the department column and calculates the count of employees for each department using COUNT(employee_id) . The HAVING clause filters groups to include only those with a count greater than 5. The HAVING clause is specifically used for filtering after applying aggregate functions, unlike WHERE , which filters rows before aggregation. This query is commonly used in scenarios like resource allocation, workforce analysis, and performance reporting. Option A: The query does not display individual employee details, only aggregated department data. Option B: HAVING is valid with aggregate functions, provided it follows GROUP BY . Option D: This interpretation mixes individual and aggregated data, which is not possible here. Option E: The HAVING clause explicitly filters results, so this option is incorrect.
When were the National Energy Conservation Awards (NECA) instituted?
Which country emerged as the third-largest exporting platform in India?
Who has been appointed as the Chairperson of the United Nations Internal Justice Council?
What strategic initiative did Google Pay and NPCI International Payments recently sign an agreement for?
What technological initiative under e-NAM helps in the quality assaying of agricultural produce?
Who was the first winner of the Arjuna Award in Kabaddi?
What is the IMF’s GDP growth projection for India in 2025-26, as per its World Economic Outlook?
Which state won the IDCA Under-19 T20 cricket championship in 2024?
What was Joby Mathew’s previous personal best lift before the Cairo 2025 Championship?
For which type of InvITs will the OFS trading lot be the same as the trading lot prescribed in the secondary market under SEBI's Infrastructure Investme...