GATE CS 2021 (Afternoon) — Question 41

Database Management Systems (DBMS)SQL Queries (DDL/DML, Joins, Aggregations)MCQ2 marks · −2/3 if wrongMedium

The relation scheme given below is used to store information about the employees of a company, where empId is the key and deptId indicates the department to which the employee is assigned. Each employee is assigned to exactly one department. emp(\underline{empId}, name, gender, salary, deptId) Consider the following SQL query:
sql
1select deptId, count(*)
2from emp
3where gender = "female" and salary > (select avg(salary) from emp)
4group by deptId;
5
The above query gives, for each department in the company, the number of female employees whose salary is greater than the average salary of
  1. A
    employees in the department.
  2. B
    employees in the company.
  3. C
    female employees in the department.
  4. D
    female employees in the company.
Practise the full 2021-AN paper
Challenge a friend: WhatsApp Telegram
From RENYXERAWhat rank do your marks get?GATE score, likely All-India Rank and qualifying marks for your category.
Practise more on SQL Queries (DDL/DML, Joins, Aggregations)Timed, in the real exam interface · free to start

A GATE question every morning

One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.

Join
Stuck? Ask in the student group