Skip to content
Open

sql1 #91

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
5 changes: 0 additions & 5 deletions README.md

This file was deleted.

15 changes: 15 additions & 0 deletions sql_1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Q1:
SELECT name, population, area FROM world WHERE area>=3000000 or population>=25000000

Q2:
CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT

RETURN (
WITH CTE AS(
SELECT *, DENSE_RANK()OVER(ORDER BY Salary DESC) as rankzz from employee
)
SELECT DISTINCT salary from CTE where rankzz=n
);

Q3:
DELETE p1 from person p1 CROSS JOIN person p2 where p1.email=p2.email and p1.id>p2.id