Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions Sql_Solutions/Problem1.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Write your MySQL query statement below
select name, population, area from world
where area>= 3000000 or population>= 25000000;
3 changes: 3 additions & 0 deletions Sql_Solutions/Problem3.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Write your MySQL query statement below
DELETE p1 from person p1 JOIN person p2
on p1.email=p2. email and p1.id > p2.id;
9 changes: 9 additions & 0 deletions Sql_Solutions/problem2.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
BEGIN
RETURN (
# Write your MySQL query statement below.
select DISTINCT salary from
(select salary, dense_rank() OVER (ORDER BY salary DESC) as Ranking from employee) as ranked_salary
WHERE Ranking = N
);
END