How to Create a PostgreSQL Database and Tables in 3 Minutes
For this tutorial. I assume that you have already installed Postgres and pgAdmin. If that’s not the case you can download them from here.
Open pgAdmin and the Query Tool
Every time you open pgAdming, it will ask for the master password so you can access all your databases. On the column on the left, click on Server > Local Postgres > Databases > postgres. This is a Postgres instance that is created when you install it.
After you have clicked on Postgres database, you have to open the query tool. Using this tool, you can write all your SQL statements.
Once opened, on the right side, a text editor will open for writing SQL commands. The Scratch Pad is used to hold text or scripts only.
Creating a Database and Tables
To create a database, we need to run the following command:
CREATE DATABASE databasetutorial;