OneCompiler
PostgreSQL

PostgreSQL

Database

A running PostgreSQL database, ready in about ten seconds. Choose a sample dataset when you launch and the workspace boots with the tables already created and filled, so you can connect from VS Code and start writing SQL straight away.

What's included

Preloaded sample data

Pick a dataset at launch and the database comes up with the tables created and rows inserted. Options include Employees, USA Zip Codes, Times Person of the Year and Cats in movies.

Real VS Code

The full cloud editor with an integrated terminal, so you can open psql and run queries without leaving the browser.

Quick start

The instance launches in about ten seconds with the sample data already loaded, so there's nothing to install or import.

Practice and prototype

Write joins, aggregations and subqueries against realistic data, or start from an empty database and design your own schema.

Tech stack

PostgreSQLpsqlSQLVS Code

What is PostgreSQL?

PostgreSQL is a mature, open-source relational database known for standards compliance and a deep feature set. It stores data in tables and you query it with SQL, with strong support for complex queries, constraints and a wide range of data types. It's a common choice for everything from small projects to large applications.

This workspace gives you a real Postgres server that's already running. Rather than installing a database locally and loading data yourself, you choose a sample dataset at launch and the workspace boots with it in place, so you can get straight to querying.

What's inside this workspace

You get a live PostgreSQL instance and a cloud VS Code editor with a terminal. When you launch, you choose one of the sample datasets and the database comes up with those tables created and populated.

The Employees dataset is a small HR schema with departments, employees, leaves and salaries. USA Zip Codes is a single table of US cities with population and coordinates. Times Person of the Year lists each year's honoree with country and category. Cats in movies catalogs films featuring cats. Want a clean slate instead? Pick None and you get an empty database to build in.

How to use it

Open the terminal in VS Code, launch psql against the running instance and start writing SQL. Run SELECTs over the sample tables, join across them, group and aggregate, or create your own tables and insert data. The instance is sized for learning and prototyping at 50MB across up to 20 tables, so it fits experiments rather than production workloads.

What you can do with it

Practice SQL against realistic data, prototype a schema for a side project, sanity-check a query before running it elsewhere, or follow a Postgres tutorial without having to set up a database first.

Frequently asked questions

Which sample datasets are included?

You can launch with Employees, USA Zip Codes, Times Person of the Year, or Cats in movies. Each comes with the tables created and the rows already loaded.

Can I start with an empty database?

Yes. Pick None at launch and you get an empty PostgreSQL database with no sample tables, ready for you to create your own schema.

How do I connect and run queries?

Open the integrated terminal in VS Code and start psql against the running instance, then type your SQL. It all happens inside the browser workspace.

How big can the database get?

The instance is meant for practice and prototyping, with around 50MB of storage and up to 20 tables. It's ideal for sample data and experiments, not production loads.

How long does it take to start?

About ten seconds. The sample data is loaded during launch, so the database is ready to query as soon as the workspace opens.

Is it free?

No, PostgreSQL is a paid template and needs a paid plan. Templates that are free are marked as such. You can upgrade from the pricing page to launch it.

Related templates

PostgreSQL online Studio — cloud Postgres playground | OneCompiler