Postgres DBA · Lesson 8

Create and connect to the Postgresql Database through cmd

-> To create the databse go to installation directory of postgres and create the database as follows. cmd:/usr/local/pgsql/bin/createdb test1 -p 5432 -> To conncet to the database use the cmd as below. cmd:/usr/local/pgsql/bin/psql test1 -p 5432 -> Now we can able to…

connected · blinksql_demo

-> To create the databse go to installation directory of postgres and create the database as follows.
cmd:/usr/local/pgsql/bin/createdb test1 -p 5432

-> To conncet to the database use the cmd as below.
cmd:/usr/local/pgsql/bin/psql test1 -p 5432

switch to the db
-> Now we can able to perform all DDL,DML,DQL,DCL on our database.

Practice — AI-generated for this lesson

Write a query that shows each order status and how many orders have it — but only statuses with more than 1 order.