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.
In a triangle ABC, AD is the altitude from A to BC. If AD = 12 cm, AB = 13 cm, and AC = 14 cm, find the length of BC.
The corresponding medians of two similar triangles are 12 cm and 15 cm. If the area of the first triangle is 288 cm, then find the area of the second tr...
- In triangle ABC, a line DE is drawn parallel to side BC. If AD = 6 cm, DB = 4 cm, and AE = 9 cm, determine the length of AC.
- In triangle DEF, GH is drawn parallel to side EF. If DG = 9 cm, GE = 3 cm and DH = 6 cm, find DF.
The base of a pyramid is an equilateral triangle whose side is 8 cm. Is. Its (slant edge) is 24 cm. What is the total surface area (in cm²) of the pyra...
If the side of an equilateral triangle is 12cm, then find the area (in cm 2 ) of the triangle (correct to two decimal places).
Find the hypotenuse of an isosceles right-angled triangle where each of the equal sides is 7√5 cm.
- Determine the length of side BC if ∠BAC = 60⁰, AB= 10 cm and AC = 15 cm.
What is the height of an equilateral triangle with a side length of 8√3 cm?
- Find the altitude of an equilateral triangle whose side is 8√3 cm.