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.
Which of the following is prepared for each job regardless of the time taken for the completion of the job?
Firm's Cost of Capital is the average cost of:
Which of the following fintech firm became the first online bond platform provider to receive a debt brokerage license from SEBI?
Consider the following Statements and choose the option with correct Statements about the Atal Pension Yojana.
I- GoI will co-contribute 50% of ...
Which of the following Bank has been permitted to set up its subsidiary in IFSC for providing specialized services as per Union Budget 2023 announcements
What distinguishes a credit union from a commercial bank?
What is the prescribed risk weight for calculating the regulatory capital corresponding to the assets covering public private partnership (PPP) and pos...
ABC Ltd reports capital expenditure of Rs 12000, long-term asset sales of Rs 4000, and depreciation expense of Rs 1200. The long-term asset sales were f...
The whole is greater than the sum of the parts is emphasised in which of the following theory of management thought?
What is the new INR Swap Window support included in the SAARC Currency Swap Framework for 2024-2027?