day 25:- Leet Code Problem 176. Second Highest Salary

Published: 31 August 2024
on channel: DEwithAbhishekTripathi
97
4

Write an SQL query to report the second highest salary from the Employee table. If there is no second highest salary, the query should report null.

CREATE TABLE Employee (
Id INT PRIMARY KEY,
Salary INT
);


-- Example 1: Insert data with multiple salaries
INSERT INTO Employee (Id, Salary) VALUES
(1, 100),
(2, 200),
(3, 300);

CREATE TABLE Employee2 (
Id INT PRIMARY KEY,
Salary INT
);
-- Example 2: Insert data with only one salary
INSERT INTO Employee2 (Id, Salary) VALUES
(1, 100);


Watch video day 25:- Leet Code Problem 176. Second Highest Salary online without registration, duration hours minute second in high quality. This video was added by user DEwithAbhishekTripathi 31 August 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 9 once and liked it people.