Skip to content
Open

SQL1 #92

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions SQL1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Q1.
# Write your MySQL query statement below
select name, area, population from World
where
area >= 3000000
or
population >= 25000000

Q2.
CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
BEGIN
RETURN (
# Write your MySQL query statement below.
with CTE as (
SELECT *, DENSE_RANK()
Over (Order By salary Desc)
as RNK From Employee
)
SELECT DISTINCT IFNULL (salary, Null)
From CTE where RNK = N

);
END

Q3.