------------------------------------------SQL Interview Question --------------------------------
---Write the SQL to return all the employees those salary are same in same department-------------
------------------------------------------------------------Sample data & Code---------------------------------------------------
CREATE TABLE [emp_salary]
(
[emp_id] INTEGER NOT NULL,
[name] NVARCHAR(20) NOT NULL,
[salary] NVARCHAR(30),
[dept_id] INTEGER
);
INSERT INTO emp_salary
(emp_id, name, salary, dept_id)
VALUES(101, 'sohan', '3000', '11'),
(102, 'rohan', '4000', '12'),
(103, 'mohan', '5000', '13'),
(104, 'cat', '3000', '11'),
(105, 'suresh', '4000', '12'),
(109, 'mahesh', '7000', '12'),
(108, 'kamal', '8000', '11');
-------------------------------Table got created----------------------------------------------------------------------------------------------
No comments:
Post a Comment