Skip to content

3NF conversion to dimensional modelling and OLAP operations, Advanced SQL queries(DML)

Notifications You must be signed in to change notification settings

RammySekham/dml-pagila

 
 

Repository files navigation

Running Pagila on your system for querying:

  1. Install postgreSQL on your system. Link (While downloading you can set user_name and password)

  2. Run in Command line

        cd "C:\Program Files\PostgreSQL\13\bin"
    
  3. Initiate psql

        psql -h 127.0.0.1 -U user_name
    
  4. Enter password when prompted for user

  5. In postgres#

        Create database pagila
    
  6. Download pagila-schema.sql and pagila-data.sql OR clone the repository to save the files on you system

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

  8. 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
    
  9. Pagila database is created.

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

About

3NF conversion to dimensional modelling and OLAP operations, Advanced SQL queries(DML)

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PLpgSQL 99.4%
  • Jupyter Notebook 0.6%