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.
What is the validity period of Shelf Prospectus?
As per Section 8 of the Registration Act, 1908, the State Government may appoint officers to be called ___________ of Registration offices, and may pres...
Penalty for cartelisation may extend up to:
The oath of office to the governor is administered by
Under Section 2(d) of the Indian Contract Act, 1872, what is the definition of "consideration"?
A continuing guarantee may at any time be revoked by the surety_____________
Which order is related to the maxim action personalis moritur cum persona
Which of the following rights is granted to the registered proprietor of a trademark under the Trade Marks Act, 1999?
Under Section 52 of the Indian Easements Act, 1882, easements are void if acquired for:
As per Section 111(1) BNS, “organised crime” necessarily requires: