-- create a table
CREATE TABLE employee (
first varchar(20),
last varchar(20),
age int,
salary int,
location varchar(20)
);
insert into employee values('sachin','sharma',28,10000,'Bangalore');
insert into employee values('shane','Warne',30,20000,'Bangalore');
insert into employee values('rohit','sharma',31,30000,'Hydrabad');
insert into employee values('Shikhar','Dhawan',32,25000,'Hydrabad');
insert into employee values('Rahul','Dravid',31,20000,'Bangalore');
insert into employee values('saurabh','Ganguly',32,15000,'Varanasi');
insert into employee values('kapil','dev',34,10000,'Varanasi');
-- select * from employee;
SELECT '---------ROW_NUMBER----------------' AS '';
select *, ROW_NUMBER() OVER(order by salary desc) as rn from employee;
SELECT '----------RANK---------------' AS '';
select *, RANK() OVER(order by salary desc) as rn from employee;
SELECT '-----------DENSE_RANK--------------' AS '';
select *, DENSE_RANK() OVER(order by salary desc) as rn from employee;
To embed this project on your website, copy the following code and paste it into your website's HTML: