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 which year Bombay Stock Exchange was established?
Inland Waterways Authority of India is the statutory authority in charge of the waterways in India.It was constituted under IWAI Act-_______Â by the Pa...
What is the maximum annual deposit limit under Sukanya Samriddhi Yojna ?.
The Paris Agreement is a legally binding international treaty on climate change. It was adopted by how many Parties at the UN Climate Change Conferenc...
What is the World Bank's stated official goal?
The training programme under the Pradhan Mantri Kaushal Vikas Yojana comes under?
The purchase of shares and bonds of Indian companies by Foreign Institutional Investors is called?
Which of the following give finance to young, start-up companies?
Regarding GDP, consider the following statements:
1. Salaries earned by foreign employees in Mumbai are included in India’s GDP.Â
2. Sa...
Consider the following statements regarding the privatization of the public sector enterprises:
1. Privatization is the liquidation of government...