Рет қаралды 1,136
In this video, we will solve two Data Analyst Interview Questions.
i. Find Top salaried employees in each department.
#sql #dataanalyst #dataengineers
ii. Find Employees earning more salary than their department's average salary.
We will solve these problems using Window functions in SQL.
For a Quick Call or do you want to discuss any doubt in the data analytics field (Data Analyst / Data Engineer / Data Scientist / Power BI Developer / Business Analyst Roles) with me don't hesitate to book a call through my Topmate.io profile.
topmate.io/mah...
My medium blogs: / mahendraee204
My github: github.com/mah...
Here are the table create and insert statements:
-----------------------------------------------------------------------------
create table employee (
employee_id int,
employee_name varchar(20) ,
age int ,
department varchar(20) ,
salary int
)
insert into employee values
(1, 'Amit Sharma', 30, 'Engineering', 75000),
(2, 'Neha Verma', 27, 'Marketing', 65000),
(3, 'Ravi Kumar', 35, 'Sales', 80000),
(4, 'Priya Singh', 29, 'HR', 60000),
(5, 'Suresh Gupta', 40, 'Finance', 90000),
(6, 'Anita Joshi', 32, 'Engineering', 70000),
(7, 'Rahul Patil', 26, 'Marketing', 62000),
(8, 'Sneha Desai', 38, 'Sales', 85000),
(9, 'Vikas Nair', 31, 'HR', 61000),
(10, 'Pooja Iyer', 45, 'Finance', 95000),
(11, 'Karan Mehta', 28, 'Engineering', 68000),
(12, 'Alok Pandey', 34, 'Marketing', 67000),
(13, 'Geeta Menon', 36, 'Sales', 82000),
(14, 'Nisha Pillai', 41, 'HR', 62000),
(15, 'Vivek Reddy', 37, 'Finance', 88000),
(16, 'Sanjay Kulkarni', 33, 'Engineering', 72000),
(17, 'Rekha Bhatt', 29, 'Marketing', 64000),
(18, 'Manoj Yadav', 43, 'Sales', 83000),
(19, 'Deepa Rao', 39, 'HR', 63000),
(20, 'Ramesh Chandra', 42, 'Finance', 91000),
(21, 'Mahendra' , 30, 'Engineering', 75000),
(22, 'Mahi', 32, 'Marketing', 67000);