SQL Questions
SQL Questions
No
Q1 Here is a sample data set of employees with theri salaries. The sub parts of this are listed belo
Questions-
a. list the last 25% employees (as per theri salary)
b. list all the employees who have salary greater than the average salary of the entire dataset
c. Employees with Salaries Higher Than Their Departmental Average
d. Find the Duplicate Rows
e. Find the employee with the second highest salary
Q3 employee_table employment_table
Emp_ID Emp_Name Emp_No Emp_ID Emp_Profile
101 Ashish Kaktan9450425345 101 Content Writer
102 Raj Choudhary8462309621 104 Data Analyst
103 Vivek Oberoi 7512309034 105 Software Engi
104 Shantanu Khan9020330023 108 Development E
105 Khanak Desai 8451004522 109 Marketing Man
109 Content Writer
101 Development E
105 Data Analyst
a. Fetch the following list using SQL- Emp_id, Emp_name, latest Emp_Profile, latest Emp_join_date.
Q4 employee_table employee_detail_table
Emp_ID Emp_Profile Emp_Email Emp_CountryEmp_Email
101 Content [email protected] Germany ashish@scaler
104 Data Analyst [email protected] India shantanu@sca
105 Software Engi [email protected] India khanak@scale
109 Development [email protected] Europe akshay@scale
108 Marketing [email protected]
a. fetch the following - emp_id, emp_email, emp_country, emp_joindate. Which join would you use, a
rts of this are listed below. Answer the below questions using SQL query
expertise
Senior
junior
Semisenior
Senior
Junior
Senior
Senior
Senior
Junior
Emp_CountryEmp_Join_Date
Germany 2021-04-20
India 2022-12-11
India 2022-01-03
Europe 2023-02-15
Mexico 2020-05-23
Germany 2021-05-23
Europe 2022-05-23
India 2023-05-23
ile, latest Emp_join_date. Each employee should have only one row in the output
Emp_JoinDate
2021-04-20
2022-12-11
2022-01-03
2023-02-15