Question
Make sure those queries can work in sql server Q-35. Write An SQL Query To Fetch The List Of Employees With The Same Salary. Ans.
Make sure those queries can work in sql server
Q-35. Write An SQL Query To Fetch The List Of Employees With The Same Salary. Ans.
The required query is:
Select distinct W.WORKER_ID, W.FIRST_NAME, W.Salary from Worker W, Worker W1 where W.Salary = W1.Salary and W.WORKER_ID != W1.WORKER_ID;
Q-36. Write An SQL Query To Show The Second Highest Salary From A Table. Ans.
The required query is:
Select max(Salary) from Worker where Salary not in (Select max(Salary) from Worker);
Q-37. Write An SQL Query To Show One Row Twice In Results From A Table. Ans.
The required query is:
select FIRST_NAME, DEPARTMENT from worker W where W.DEPARTMENT='HR' union all select FIRST_NAME, DEPARTMENT from Worker W1 where W1.DEPARTMENT='HR';
Q-38. Write An SQL Query To Fetch Intersecting Records Of Two Tables. Ans.
The required query is:
(SELECT * FROM Worker) INTERSECT (SELECT * FROM WorkerClone);
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started