Running Pagila on your system for querying:
-
Install postgreSQL on your system. Link (While downloading you can set user_name and password)
-
Run in Command line
cd "C:\Program Files\PostgreSQL\13\bin"
-
Initiate psql
psql -h 127.0.0.1 -U user_name
-
Enter password when prompted for user
-
In postgres#
Create database pagila
-
Download pagila-schema.sql and pagila-data.sql OR clone the repository to save the files on you system
-
Filepath1 corresponds to path of pagila-schema.sql (i.e. D:\Myfiles\Data\pagila-schema.sql) Filepath2 corresponds to path of pagila-data.sql (i.e. D:\Myfiles\Data\pagila-data.sql)
-
In command line. Run (enter password if prompted)
psql -h 127.0.01 -d pagila -U user_name -p 5432 -a -q -f filepath1 psql -h 127.0.01 -d pagila -U user_name -p 5432 -a -q -f filepath2
-
Pagila database is created.
-
For quering in Jupyter Notebook Open Jupyter notebook and run commands in order below:
!pip install ipython-sql % load_ext sql conn_string = postgresql://<user_name>:<password>@127.0.0.1:5432/pagila %sql $conn_string
-
You are ready to explore data in jupyter notebook
%sql Select rating from film limit 5;
My exercises are contained in these files:
1. create_fact_dimensions_table & ETL_3NF_to_factdimtables: Conversion of 3NF form to Dimensional form and loading data.
2. OLAP_Cubes: Shows Slicing, Dicing, Roll Up, Drill down, Grouping Sets and Creating Cube