Ensure you have
PSQLinstalled
Connecting to your DB
psql --host=localhost --port=5432 --username=developer --dbname=dummyDb --password
Once connected,
- list your tables with 
\d - If you have a simple query simple type into the cli and execute your query directly.
 - If you have a query thats too long, you can choose to load your query into the buffer using 
\e. - To execute your query stored in the buffer, run 
\g. - To quite psql, run 
\q