PostgreSQL Query Generator

Describe what you need in plain English — get working PostgreSQL query

Try an example

Filter rows

Show all employees with salary greater than 80000

Count by group

Count employees in each department

Top N

Find the top 5 highest paid employees

Date filter

Get employees who joined in the last 6 months

Average by group

Show average salary by department sorted by highest average

HAVING filter

Find departments with more than 5 employees

JOIN tables

Show employee names with their department name using a join

CREATE TABLE

Create a table for storing customer orders

Generated PostgreSQL Query