Preparing Database¶
Let us setup the database along with tables to see how the batch loads are typically done.
We have scripts and data set available in our GitHub repository. If you are using our environment the repository is already cloned under /data/retail_db.
It have scripts to create tables with primary keys. Those scripts are generated from MySQL tables and refactored for Postgres. We will create the tables and load the data from the files.
Script to create tables: create_db_tables_pg.sql
Here are the commands to launch
psql
and run scripts to create tables as well as load data into tables.