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
2 changes: 2 additions & 0 deletions BigCountries.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SELECT NAME,POPULATION,AREA FROM WORLD
WHERE AREA>= 3000000 OR POPULATION>=25000000;
3 changes: 3 additions & 0 deletions DeleteDuplicateEmail.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

DELETE P1 FROM PERSON P1
CROSS JOIN PERSON P2 WHERE P1.EMAIL = P2.EMAIL and P1.ID >P2.ID
9 changes: 9 additions & 0 deletions NthHighestSalary.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
BEGIN
Declare m int;
set m = (n-1);
RETURN (
select distinct salary from employee order by salary desc
limit m,1
);
END