RDBMS ASSIGNMENT

Post on 17-Jun-2015

205 views 2 download

Tags:

description

SQL queries

Transcript of RDBMS ASSIGNMENT

RDBMS ASSIGNMENT

By,Ritam GhoshA14025

Listing 1.1: Creating dwid user id

Listing 1.2: Creating dw and source databases

Listing 1.3: Creating data warehouse tables

Listing 2.1: Applying SCD1 to the customer names in customer_dim

Listing 2.2: Creating and loading the customer_stg table

Listing 2.3: Applying SCD2 to product_name and product_category in the product_dim table

Listing 2.4: Creating the product_stg table

Listing 2.5: Loading products to its staging table

Listing 3.2: Querying across all dimensions

Listing 3.3: Querying across the date, product, and order

Listing 3.5: Querying across the date and order

Listing 4.2: Daily Aggregation

Listing 4.3: Annual aggregation

Listing 4.5: Specific query (quarterly sales in Mechanicsburg)

Listing 4.6: Inside-out - Monthly Product Performer

Listing 4.7: Inside-out (loyal customer)

Listing 5.3: Data for testing Push mode

Listing 6.1: Stored procedure to pre-populate the date dimension

Listing 6.2: Daily date population

Listing 6.3: Loading dates from the source

Listing 8.1: Daily dw regular population

Listing 8.2: Adding sales orders

Listing 10.2: Adding the order quantity column

Listing 10.3: Revised daily DW regular population

Listing 10.5: Adding nine sales orders with order quantities

Listing 11.2: Populating the promotion indicator

Listing 12.2: The revised date pre-population script

Listing 12.3: PA customers

Listing 12.4: Non-PA customers

Listing 12.6: Adding two customers

Listing 13.1: Adding the request_delivery_date_sk column

Listing 13.2: The revised daily DW regular population

Listing 13.3: Adding the request_delivery_date column to the sales_order table

Listing 13.4: Adding three sales orders with request delivery dates

Listing 13.5: Daily sales summary

Listing 13.6: Creating date views

Listing 13.7: Database view role playing

13.8 the final

THANK YOU