Which of the following queries will display the employees fullnames whose salary is more than android department employees average salary?
select fname+lname as 'fullname' from employees where salary>avg(salary) and dept='android' ;
/*declaring variable in sql */
declare @and_dept_avgsal int;
select @and_dept_avgsal=AVG(salary) from employees where dept='android';
select fname+lname as 'fullname' from employees where salary>@and_dept_avgsal;
select fname+lname as fullname where salary>avg(select salary from employees where dept='android')
None of the above.
In sql language will not allow aggregate functions in where clause . Hence first and third queries will not work . Second query is using
declaring variable .
Back To Top