Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Case Studies In Business Data Bases

Authors: James Bradley

1st Edition

0030141346, 978-0030141348

More Books

Students also viewed these Databases questions