recategorized by
752 views
0 0 votes

The employee information in a company is stored in the relation

Employee (name, sex, salary, deptName)

Consider the following $\text{SQL}$ query

Select deptName
    From Employee
    Where sex = ‘M’
    Group by deptName
    Having avg(salary) >
        (select avg (salary) from Employee)

It returns the names of the department in which

  1. the average salary is more than the average salary in the company

  2. the average salary of male employees is more than the average salary of all male employees in the company

  3. the average salary of male employees is more than the average salary of employees in same the department

  4. the average salary of male employees is more than the average salary in the company

Please log in or register to answer this question.

Answer:
Position:
Show:

Related questions

0 0 votes
0 0 answers
572
572 views
soujanyareddy13 asked Apr 12, 2022
572 views
Given the following schema:employees (emp-id, first-name, last-name, hire-date, dept-id, salarydepartments (dept-id, dept-name, manager-id, location-id)You want to displa...
4 4 votes
1 answers 1 answer
1.5k
1.5k views
soujanyareddy13 asked Apr 12, 2022
1,469 views
Let $\text{R (A, B, C, D)}$ be a relational schema with the following functional dependencies: $\text{A} \rightarrow \text{B, B} \rightarrow \text{C}$ $\text{C} \rightar...
2 2 votes
1 answers 1 answer
1.3k
1.3k views
soujanyareddy13 asked Apr 12, 2022
1,325 views
The relation scheme $\text{Student Performance (name, courseNo, rollNo, grade)}$ has the following functional dependencies:name, courseNo, $\rightarrow$ graderollNo, cour...
1 1 vote
2 2 answers
1.2k
1.2k views
soujanyareddy13 asked Apr 12, 2022
1,175 views
Consider the following two phase locking protocol. Suppose a transaction $\text{T}$ accesses (for read or write operations), a certain set of objects $\{\text{O1},\ldots,...