In this video, we solved a counter question that has been asked frequently in the most recent data engineer or data analyst interviews.
#interview #sqlwindowfunctions #datascience #sql #sqlfunctions
Here are My profiles that will definitely help your preparation for data analyst or data engineer roles.
Medium: / mahendraee204
Github: github.com/mahendra204
Q) Return Employee details who earn a higher salary than the average salary of all managers in the organization.
Table Creation and Insertion Statements:
------------------------------------------------------------------
create table employee (
empid int,
empname varchar(50),
mgrid int,
salary int
);
insert into employee values
(1, 'mahendra', 2, 25000),
(2, 'mahi', 5, 20000),
(3, 'sam', null, 45000),
(4, 'dev', 1, 20000),
(5, 'dash', 3, 97000),
(6, 'pratik', 6, 30000),
(7, 'singh', 2, 40000),
(8, 'rao', 5, 80000);
18 июн 2024