-> 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.