PostgreSQL playground

select
  dense_rank() over w as rank,
  first_name, department.name as dep_name,
  salary
from employee
  join department using(dep_id)
window w as (order by salary desc)
order by rank, emp_id;

PostgreSQL is a powerful, open source object-relational database system with a reputation for reliability, feature robustness, and performance.

⛫ homepage • αω tutorial • ⚘ community

Sandbox details

Postgres version:   16.4
sandbox engine:     codapi
sandbox name:       postgres
allowed commands:   run
in-browser:         via pglite

Usage example:

```sql
select 'Hello, World!' as message;
```

<codapi-snippet sandbox="postgres" editor="basic">
</codapi-snippet>

Documentation