How to Setup Retail Database in PostgreSQL?

Issue

I’m not able to find the tables in PostgreSQL database provided to me. How can I get or create to get stat with PostgreSQL DB?

Solution

Follow the below steps to launch the terminal and connect to database from Jupyter

  • Open the Gateway link provided to login to Jupyter from here lab_details

  • Click on File in menu bar -> New -> Terminal

  • In terminal run following command by replacing itv****** with your lab userID and password provided to connect to retail database

psql -U itv******_retail_user \
-h pg.itversity.com \
-p 5433 \
-d itv******_retail_db \
-W

  • After connecting to the database run the below commands to create retail tables and load data into them -

\i /data/retail_db/create_db_tables_pg.sql
\i /data/retail_db/load_db_tables_pg.sql