SlideShare a Scribd company logo
1 of 17
DIMENSION
MODELLING
ISM-6028
DIVYA RAJASRI TADI
ISHRAIN HUSSAIN
MADHURI CHADALAPAKA
SHWETHA THYAGARAJACHARY
Dimensional Modeling
• This approach involves a set of techniques and concepts used in data
warehouse design. It is design technique for databases intended to
support end-user queries in a data warehouse. It is oriented around
understandability and performance.
• Dimensional modeling always uses the concepts of facts (measures),
and dimensions (context). Facts are typically numeric values that can
be aggregated, and dimensions are groups of hierarchies and
descriptors that define the facts. For example, sales amount is a fact;
timestamp, product, register#, store#, etc. are elements of dimensions.
• Dimensional models are built by business process area, e.g. store
sales, inventory, claims, etc. Because the different business process
areas share some but not all dimensions, efficiency in design,
operation, and consistency, is achieved using conformed dimensions.
INTRODUCTION
Fact Table
•Stocks Fact
Dimension Table
•Political Parties: Information about ruling political parties
and current presidency
•Company: Information about the Companies involved in
the stock market
•Supply & Demand: Fluctuation in the stock price and the
relative increase or decrease in the supply & demand
•Hype: Popluarity of a product or company
Step1 - Select the business process to
model
•There are various factors that are crucial while analyzing the stock
market like Economy, Scandals, Politics, Hype, Supply and Demand,
Natural disasters, expectation and speculation, war, politics, global
events, news related to companies etc., The business model that can
be built on the Stocks database is the stock value pertaining to various
dimensions.
•For instance, let’s consider the business problem as “finding the
industry with the highest stock value in the past decade occurred under
which political party’s reign and in which quarter.”
QUERY
SELECT S.COMPANY, S.GICS_SECTO ,Q.TRADE_YEAR,
P.CONGRESS_ID,
P.CONGRESS_NAME,P.WHITEHOUSE_PARTY, MAX(Q.HIGH) AS
MAX_HIGH
FROM POLITICAL_PARTIES P,SP500_EOD_STOCKS E,STOCKS S,
SP500_QUARTERLY_FACTS Q
WHERE Q.TRADE_YEAR BETWEEN 2005 AND 2015
GROUP BY
S.COMPANY,S.GICS_SECTOR,Q.TRADE_YEAR,P.CONGRESS_ID,
P.CONGRESS_NAME,
P.WHITEHOUSE_PARTY
ORDER BY
MAX(Q.HIGH) DESC
Which yields the following result snapshot that clearly indicates
that in the past decade, the financial sector has the highest
stock (1197.66) under the ruling of Democrats.
COMPANY GICS_SECTOR TRADE_YEA
R
CONGRESS_ID CONGRESS_NAME WHITEHOUSE_PARTY MAX_HIGH
Allstate Corp Financials 2005 87 87th Democrat 1197.66
Citigroup Inc. Financials 2005 87 87th Democrat 1197.66
Amgen Inc Health Care 2005 87 87th Democrat 1197.66
Broadcom
Corporation
Information
Technology
2005 87 87th Democrat 1197.66
Anadarko Petroleum
Corp
Energy 2005 87 87th Democrat 1197.66
Adobe Systems Inc Information
Technology
2005 87 87th Democrat 1197.66
Boston Scientific Health Care 2005 87 87th Democrat 1197.66
Becton Dickinson Health Care 2005 87 87th Democrat 1197.66
BMC Software Information
Technology
2005 87 87th Democrat 1197.66
Apple Inc. Information
Technology
2005 87 87th Democrat 1197.66
Step2 - Declare the grain of the
business process
The granularity of a dimension depends on how often it is modified. If
the Political party dimension is considered, the
POLITICAL_PARTIES table is modified only after every election or
when change in the government takes place. So, we do not need a
fine grain for this dimension. The political party dimension table is as
follows:
POLITICAL_PARTIES
COLUMN_NAME DATA_TYPE
CONGRESS_ID NUMBER(3,0)
CONGREE_YEAR NUMBER(4,0)
WHITEHOUSE_PARTY VARCHAR2(20 BYTE)
PRESIDENT_NAME VARCHAR2(20 BYTE)
CONGRESS_NAME VARCHAR2(10 BYTE)
HOUSE_MAJORITY VARCHAR2(20 BYTE)
HOUSE_DEMOCRATS NUMBER(3,0)
HOUSE_REPUBLICANS NUMBER(3,0)
HOUSE_OTHERS NUMBER(3,0)
SENATE_MAJOIRTY VARCHAR2(20 BYTE)
SENATE_DEMOCRATS NUMBER(3,0)
SENATE_REPUBLICANS NUMBER(3,0)
SENATE_OTHERS NUMBER(3,0)
FOOTNOTE VARCHAR2(200 BYTE)
Step3 - Choose the dimensions that
apply to each fact table row
• For the business problem under consideration, we can have Political
Parties as one of the dimensions, so the fact table and dimension
tables are as follows:
Step4 - Identify the numeric facts that
will populate each fact table row
 
Once the fact and dimensional tables are in place, it is easy to identify
the numeric facts such as which company has the highest stock in
which year under which ruling party will become quite obvious. In this
scenario, the numeric fact is that the company Allstate Corp, in the
trade year 2005 has the maximum high stock of 1197.66 under
Democratic Party ruling with congress id 87.
 
QUERY 2
SELECT d.company_name, sum(s.volume) "Volume"
FROM SP500_EOD_STOCK_FACTS s,COMPANY_DIM d
WHERE s.TICKER_SYMBOL=d.TICKER_SYMBOL and
d.COMPANY_name is not null
GROUP BY cube(s.VOLUME), d.COMPANY_name order by "Volume"
desc;
QUERY 2 OUTPUT
COMPANY VOLUME
BANK OF AMERICA 465813622
GENERAL ELECTRIC 204452485
MICROSOFT CORP 148263502
PFIZER INC 141891968
E-TRADE 122969972
WELLS FARGO 109991283
CITI BANK 109892271
Dimension Table:
COMPANY_DIM
COLUMN NAME DATATYPE
TICKER_SYMBOL (PK) VARCHAR2(10)
COMPANY_NAME VARCHAR2(100)
COMPANY_LOCATION VARCHAR2(60)
COMPANY_ESTABLISHMENT_DATE DATE
NOTE VARCHAR2(150)
Dimension Table:
JULIAN_DAY_DIM
COLUMN NAME DATATYPE
JULIAN_DAY NUMBER(12)
ACTUAL_DATE DATE
DAY_NAME VARCHAR2(20 BYTE)
DAY_IN_YEAR NUMBER(3)
DAY_IN_MONTH NUMBER(3)
DAY_IN_WEEK NUMBER(3)
MONTH_NAME VARCHAR2(20 BYTE)
MONTH_NUM NUMBER(3)
YEAR_NAME VARCHAR2(40 BYTE)
YEAR_NUM NUMBER(3)
Dimension Table:
STOCK_EXCHANGE_DIM
COLUMN NAME DATATYPE
EXCHANGE_ID NUMBER(12)
EXCHANGE _DATE DATE
EXCHANGE _TIME TIMESTAMP
NUM_SHARES_EXCHANGE NUMBER
EXCHANGE_QTY VARCHAR2 (20BYTE)
EXCHANGE_COUNTRY VARCHAR2 (20BYTE)
EXCHANGE_PRICE VARCHAR2(20 BYTE)
DIMENSION MODEL
THANK YOU

More Related Content

What's hot

Dimensional data model
Dimensional data modelDimensional data model
Dimensional data modelVnktp1
 
Case study: Implementation of dimension table and fact table
Case study: Implementation of dimension table and fact tableCase study: Implementation of dimension table and fact table
Case study: Implementation of dimension table and fact tablechirag patil
 
Dimensional modeling primer
Dimensional modeling primerDimensional modeling primer
Dimensional modeling primerTerry Bunio
 
Slowly changing dimension
Slowly changing dimension Slowly changing dimension
Slowly changing dimension Sunita Sahu
 
Advanced Dimensional Modelling
Advanced Dimensional ModellingAdvanced Dimensional Modelling
Advanced Dimensional ModellingVincent Rainardi
 
Fact table design for data ware house
Fact table design for data ware houseFact table design for data ware house
Fact table design for data ware houseSayed Ahmed
 
Data Warehouse Design & Dimensional Modeling
Data Warehouse Design & Dimensional ModelingData Warehouse Design & Dimensional Modeling
Data Warehouse Design & Dimensional ModelingCode Mastery
 
Difference between ER-Modeling and Dimensional Modeling
Difference between ER-Modeling and Dimensional ModelingDifference between ER-Modeling and Dimensional Modeling
Difference between ER-Modeling and Dimensional ModelingAbdul Aslam
 
Dimensional Modelling - Basic Concept
Dimensional Modelling - Basic ConceptDimensional Modelling - Basic Concept
Dimensional Modelling - Basic ConceptFolio3 Software
 
Dimensional Modeling
Dimensional ModelingDimensional Modeling
Dimensional Modelingaksrauf
 
Dimensional Modeling
Dimensional ModelingDimensional Modeling
Dimensional ModelingSunita Sahu
 
Multidimentional data model
Multidimentional data modelMultidimentional data model
Multidimentional data modeljagdish_93
 
Difference between fact tables and dimension tables
Difference between fact tables and dimension tablesDifference between fact tables and dimension tables
Difference between fact tables and dimension tablesKamran Haider
 
E-R vs Starschema
E-R vs StarschemaE-R vs Starschema
E-R vs Starschemaguest862640
 
Star ,Snow and Fact-Constullation Schemas??
Star ,Snow and  Fact-Constullation Schemas??Star ,Snow and  Fact-Constullation Schemas??
Star ,Snow and Fact-Constullation Schemas??Abdul Aslam
 
Business Intelligence and Multidimensional Database
Business Intelligence and Multidimensional DatabaseBusiness Intelligence and Multidimensional Database
Business Intelligence and Multidimensional DatabaseRussel Chowdhury
 

What's hot (20)

Dimensional data model
Dimensional data modelDimensional data model
Dimensional data model
 
Case study: Implementation of dimension table and fact table
Case study: Implementation of dimension table and fact tableCase study: Implementation of dimension table and fact table
Case study: Implementation of dimension table and fact table
 
Fact table facts
Fact table factsFact table facts
Fact table facts
 
Data Warehouse Designing: Dimensional Modelling and E-R Modelling
Data Warehouse Designing: Dimensional Modelling and E-R ModellingData Warehouse Designing: Dimensional Modelling and E-R Modelling
Data Warehouse Designing: Dimensional Modelling and E-R Modelling
 
Dimensional modeling primer
Dimensional modeling primerDimensional modeling primer
Dimensional modeling primer
 
Slowly changing dimension
Slowly changing dimension Slowly changing dimension
Slowly changing dimension
 
Advanced Dimensional Modelling
Advanced Dimensional ModellingAdvanced Dimensional Modelling
Advanced Dimensional Modelling
 
Fact table design for data ware house
Fact table design for data ware houseFact table design for data ware house
Fact table design for data ware house
 
Data Warehouse Design & Dimensional Modeling
Data Warehouse Design & Dimensional ModelingData Warehouse Design & Dimensional Modeling
Data Warehouse Design & Dimensional Modeling
 
Difference between ER-Modeling and Dimensional Modeling
Difference between ER-Modeling and Dimensional ModelingDifference between ER-Modeling and Dimensional Modeling
Difference between ER-Modeling and Dimensional Modeling
 
Dimensional Modelling - Basic Concept
Dimensional Modelling - Basic ConceptDimensional Modelling - Basic Concept
Dimensional Modelling - Basic Concept
 
Star schema
Star schemaStar schema
Star schema
 
Dimensional Modeling
Dimensional ModelingDimensional Modeling
Dimensional Modeling
 
Dimensional Modeling
Dimensional ModelingDimensional Modeling
Dimensional Modeling
 
Multidimentional data model
Multidimentional data modelMultidimentional data model
Multidimentional data model
 
Difference between fact tables and dimension tables
Difference between fact tables and dimension tablesDifference between fact tables and dimension tables
Difference between fact tables and dimension tables
 
E-R vs Starschema
E-R vs StarschemaE-R vs Starschema
E-R vs Starschema
 
Dominick’s finer foods
Dominick’s finer foodsDominick’s finer foods
Dominick’s finer foods
 
Star ,Snow and Fact-Constullation Schemas??
Star ,Snow and  Fact-Constullation Schemas??Star ,Snow and  Fact-Constullation Schemas??
Star ,Snow and Fact-Constullation Schemas??
 
Business Intelligence and Multidimensional Database
Business Intelligence and Multidimensional DatabaseBusiness Intelligence and Multidimensional Database
Business Intelligence and Multidimensional Database
 

Similar to DW DIMENSN MODELNG

Bw training 3 data modeling
Bw training   3 data modelingBw training   3 data modeling
Bw training 3 data modelingJoseph Tham
 
[MPKD1] Introduction to business analytics and simulation
[MPKD1] Introduction to business analytics and simulation[MPKD1] Introduction to business analytics and simulation
[MPKD1] Introduction to business analytics and simulationNguyen Ngoc Binh Phuong
 
Data warehouse and Business Intelligence for a Sports Goods Company
Data warehouse and Business Intelligence for a Sports Goods CompanyData warehouse and Business Intelligence for a Sports Goods Company
Data warehouse and Business Intelligence for a Sports Goods CompanyBalaji Katakam
 
Project report aditi paul1
Project report aditi paul1Project report aditi paul1
Project report aditi paul1guest9529cb
 
Real -time data visualization using business intelligence techniques. and mak...
Real -time data visualization using business intelligence techniques. and mak...Real -time data visualization using business intelligence techniques. and mak...
Real -time data visualization using business intelligence techniques. and mak...MD Owes Quruny Shubho
 
Intro to datawarehouse dev 1.0
Intro to datawarehouse   dev 1.0Intro to datawarehouse   dev 1.0
Intro to datawarehouse dev 1.0Jannet Peetz
 
Anticipating Market Research In Your Proposal
Anticipating Market Research In Your ProposalAnticipating Market Research In Your Proposal
Anticipating Market Research In Your ProposalRobert E Jones
 
Business toolkit in Powerpoint and Excel
Business toolkit in Powerpoint and ExcelBusiness toolkit in Powerpoint and Excel
Business toolkit in Powerpoint and ExcelAurelien Domont, MBA
 
Brazilian Ecommerce OLIST Market Data Analysis
Brazilian Ecommerce OLIST Market Data AnalysisBrazilian Ecommerce OLIST Market Data Analysis
Brazilian Ecommerce OLIST Market Data Analysiskaushikdey53
 
Statista Corporate Account Features
Statista Corporate Account FeaturesStatista Corporate Account Features
Statista Corporate Account FeaturesStatista
 
Husky Growth Fund - Equity Research - report template
Husky Growth Fund - Equity Research - report template Husky Growth Fund - Equity Research - report template
Husky Growth Fund - Equity Research - report template Nick Gearhart
 
IT301-Datawarehousing (1) and its sub topics.pptx
IT301-Datawarehousing (1) and its sub topics.pptxIT301-Datawarehousing (1) and its sub topics.pptx
IT301-Datawarehousing (1) and its sub topics.pptxReneeClintGortifacio
 
Sales & distribution training overview
Sales & distribution training overviewSales & distribution training overview
Sales & distribution training overviewSatyabrata Patra
 
Using_The_Predictive_Analytics_For_Effective_Cross_Selling
Using_The_Predictive_Analytics_For_Effective_Cross_SellingUsing_The_Predictive_Analytics_For_Effective_Cross_Selling
Using_The_Predictive_Analytics_For_Effective_Cross_SellingSunil Kakade
 
111Assignment Learning ObjectivesBSIS 105Assignment 3Purc.docx
111Assignment Learning ObjectivesBSIS 105Assignment 3Purc.docx111Assignment Learning ObjectivesBSIS 105Assignment 3Purc.docx
111Assignment Learning ObjectivesBSIS 105Assignment 3Purc.docxhyacinthshackley2629
 
Government Contractors and Subcontractors: Anticipating Market Research in Yo...
Government Contractors and Subcontractors: Anticipating Market Research in Yo...Government Contractors and Subcontractors: Anticipating Market Research in Yo...
Government Contractors and Subcontractors: Anticipating Market Research in Yo...SpendLogic
 
N ch01
N ch01N ch01
N ch01kk3bii
 
SCSU Investment Club - Equity Research - report template
SCSU Investment Club - Equity Research - report template SCSU Investment Club - Equity Research - report template
SCSU Investment Club - Equity Research - report template Nick Gearhart
 
Olap fundamentals
Olap fundamentalsOlap fundamentals
Olap fundamentalsAmit Sharma
 

Similar to DW DIMENSN MODELNG (20)

Bw training 3 data modeling
Bw training   3 data modelingBw training   3 data modeling
Bw training 3 data modeling
 
Data warehousing
Data warehousingData warehousing
Data warehousing
 
[MPKD1] Introduction to business analytics and simulation
[MPKD1] Introduction to business analytics and simulation[MPKD1] Introduction to business analytics and simulation
[MPKD1] Introduction to business analytics and simulation
 
Data warehouse and Business Intelligence for a Sports Goods Company
Data warehouse and Business Intelligence for a Sports Goods CompanyData warehouse and Business Intelligence for a Sports Goods Company
Data warehouse and Business Intelligence for a Sports Goods Company
 
Project report aditi paul1
Project report aditi paul1Project report aditi paul1
Project report aditi paul1
 
Real -time data visualization using business intelligence techniques. and mak...
Real -time data visualization using business intelligence techniques. and mak...Real -time data visualization using business intelligence techniques. and mak...
Real -time data visualization using business intelligence techniques. and mak...
 
Intro to datawarehouse dev 1.0
Intro to datawarehouse   dev 1.0Intro to datawarehouse   dev 1.0
Intro to datawarehouse dev 1.0
 
Anticipating Market Research In Your Proposal
Anticipating Market Research In Your ProposalAnticipating Market Research In Your Proposal
Anticipating Market Research In Your Proposal
 
Business toolkit in Powerpoint and Excel
Business toolkit in Powerpoint and ExcelBusiness toolkit in Powerpoint and Excel
Business toolkit in Powerpoint and Excel
 
Brazilian Ecommerce OLIST Market Data Analysis
Brazilian Ecommerce OLIST Market Data AnalysisBrazilian Ecommerce OLIST Market Data Analysis
Brazilian Ecommerce OLIST Market Data Analysis
 
Statista Corporate Account Features
Statista Corporate Account FeaturesStatista Corporate Account Features
Statista Corporate Account Features
 
Husky Growth Fund - Equity Research - report template
Husky Growth Fund - Equity Research - report template Husky Growth Fund - Equity Research - report template
Husky Growth Fund - Equity Research - report template
 
IT301-Datawarehousing (1) and its sub topics.pptx
IT301-Datawarehousing (1) and its sub topics.pptxIT301-Datawarehousing (1) and its sub topics.pptx
IT301-Datawarehousing (1) and its sub topics.pptx
 
Sales & distribution training overview
Sales & distribution training overviewSales & distribution training overview
Sales & distribution training overview
 
Using_The_Predictive_Analytics_For_Effective_Cross_Selling
Using_The_Predictive_Analytics_For_Effective_Cross_SellingUsing_The_Predictive_Analytics_For_Effective_Cross_Selling
Using_The_Predictive_Analytics_For_Effective_Cross_Selling
 
111Assignment Learning ObjectivesBSIS 105Assignment 3Purc.docx
111Assignment Learning ObjectivesBSIS 105Assignment 3Purc.docx111Assignment Learning ObjectivesBSIS 105Assignment 3Purc.docx
111Assignment Learning ObjectivesBSIS 105Assignment 3Purc.docx
 
Government Contractors and Subcontractors: Anticipating Market Research in Yo...
Government Contractors and Subcontractors: Anticipating Market Research in Yo...Government Contractors and Subcontractors: Anticipating Market Research in Yo...
Government Contractors and Subcontractors: Anticipating Market Research in Yo...
 
N ch01
N ch01N ch01
N ch01
 
SCSU Investment Club - Equity Research - report template
SCSU Investment Club - Equity Research - report template SCSU Investment Club - Equity Research - report template
SCSU Investment Club - Equity Research - report template
 
Olap fundamentals
Olap fundamentalsOlap fundamentals
Olap fundamentals
 

More from Divya Tadi

Effective commn
Effective commnEffective commn
Effective commnDivya Tadi
 
Effective commn
Effective commnEffective commn
Effective commnDivya Tadi
 
Economics Certificate
Economics CertificateEconomics Certificate
Economics CertificateDivya Tadi
 
Negotiation skills
Negotiation skillsNegotiation skills
Negotiation skillsDivya Tadi
 
Financial Accounting
Financial AccountingFinancial Accounting
Financial AccountingDivya Tadi
 
final team app
final team appfinal team app
final team appDivya Tadi
 
Healthcare domain PPT
Healthcare domain PPTHealthcare domain PPT
Healthcare domain PPTDivya Tadi
 
HOT TOPIC REPORT DIVYA
HOT TOPIC REPORT DIVYAHOT TOPIC REPORT DIVYA
HOT TOPIC REPORT DIVYADivya Tadi
 
MYREVIEWERS ASAD Project
MYREVIEWERS ASAD ProjectMYREVIEWERS ASAD Project
MYREVIEWERS ASAD ProjectDivya Tadi
 
ADBMS Project Pearl
ADBMS Project PearlADBMS Project Pearl
ADBMS Project PearlDivya Tadi
 

More from Divya Tadi (14)

CBAP
CBAPCBAP
CBAP
 
Effective commn
Effective commnEffective commn
Effective commn
 
Effective commn
Effective commnEffective commn
Effective commn
 
Economics Certificate
Economics CertificateEconomics Certificate
Economics Certificate
 
Negotiation skills
Negotiation skillsNegotiation skills
Negotiation skills
 
Financial Accounting
Financial AccountingFinancial Accounting
Financial Accounting
 
Data
DataData
Data
 
final team app
final team appfinal team app
final team app
 
Healthcare domain PPT
Healthcare domain PPTHealthcare domain PPT
Healthcare domain PPT
 
FINAL REPORT
FINAL REPORTFINAL REPORT
FINAL REPORT
 
DM PROJECT
DM PROJECTDM PROJECT
DM PROJECT
 
HOT TOPIC REPORT DIVYA
HOT TOPIC REPORT DIVYAHOT TOPIC REPORT DIVYA
HOT TOPIC REPORT DIVYA
 
MYREVIEWERS ASAD Project
MYREVIEWERS ASAD ProjectMYREVIEWERS ASAD Project
MYREVIEWERS ASAD Project
 
ADBMS Project Pearl
ADBMS Project PearlADBMS Project Pearl
ADBMS Project Pearl
 

DW DIMENSN MODELNG

  • 1. DIMENSION MODELLING ISM-6028 DIVYA RAJASRI TADI ISHRAIN HUSSAIN MADHURI CHADALAPAKA SHWETHA THYAGARAJACHARY
  • 2. Dimensional Modeling • This approach involves a set of techniques and concepts used in data warehouse design. It is design technique for databases intended to support end-user queries in a data warehouse. It is oriented around understandability and performance. • Dimensional modeling always uses the concepts of facts (measures), and dimensions (context). Facts are typically numeric values that can be aggregated, and dimensions are groups of hierarchies and descriptors that define the facts. For example, sales amount is a fact; timestamp, product, register#, store#, etc. are elements of dimensions. • Dimensional models are built by business process area, e.g. store sales, inventory, claims, etc. Because the different business process areas share some but not all dimensions, efficiency in design, operation, and consistency, is achieved using conformed dimensions.
  • 3. INTRODUCTION Fact Table •Stocks Fact Dimension Table •Political Parties: Information about ruling political parties and current presidency •Company: Information about the Companies involved in the stock market •Supply & Demand: Fluctuation in the stock price and the relative increase or decrease in the supply & demand •Hype: Popluarity of a product or company
  • 4. Step1 - Select the business process to model •There are various factors that are crucial while analyzing the stock market like Economy, Scandals, Politics, Hype, Supply and Demand, Natural disasters, expectation and speculation, war, politics, global events, news related to companies etc., The business model that can be built on the Stocks database is the stock value pertaining to various dimensions. •For instance, let’s consider the business problem as “finding the industry with the highest stock value in the past decade occurred under which political party’s reign and in which quarter.”
  • 5. QUERY SELECT S.COMPANY, S.GICS_SECTO ,Q.TRADE_YEAR, P.CONGRESS_ID, P.CONGRESS_NAME,P.WHITEHOUSE_PARTY, MAX(Q.HIGH) AS MAX_HIGH FROM POLITICAL_PARTIES P,SP500_EOD_STOCKS E,STOCKS S, SP500_QUARTERLY_FACTS Q WHERE Q.TRADE_YEAR BETWEEN 2005 AND 2015 GROUP BY S.COMPANY,S.GICS_SECTOR,Q.TRADE_YEAR,P.CONGRESS_ID, P.CONGRESS_NAME, P.WHITEHOUSE_PARTY ORDER BY MAX(Q.HIGH) DESC
  • 6. Which yields the following result snapshot that clearly indicates that in the past decade, the financial sector has the highest stock (1197.66) under the ruling of Democrats. COMPANY GICS_SECTOR TRADE_YEA R CONGRESS_ID CONGRESS_NAME WHITEHOUSE_PARTY MAX_HIGH Allstate Corp Financials 2005 87 87th Democrat 1197.66 Citigroup Inc. Financials 2005 87 87th Democrat 1197.66 Amgen Inc Health Care 2005 87 87th Democrat 1197.66 Broadcom Corporation Information Technology 2005 87 87th Democrat 1197.66 Anadarko Petroleum Corp Energy 2005 87 87th Democrat 1197.66 Adobe Systems Inc Information Technology 2005 87 87th Democrat 1197.66 Boston Scientific Health Care 2005 87 87th Democrat 1197.66 Becton Dickinson Health Care 2005 87 87th Democrat 1197.66 BMC Software Information Technology 2005 87 87th Democrat 1197.66 Apple Inc. Information Technology 2005 87 87th Democrat 1197.66
  • 7. Step2 - Declare the grain of the business process The granularity of a dimension depends on how often it is modified. If the Political party dimension is considered, the POLITICAL_PARTIES table is modified only after every election or when change in the government takes place. So, we do not need a fine grain for this dimension. The political party dimension table is as follows:
  • 8. POLITICAL_PARTIES COLUMN_NAME DATA_TYPE CONGRESS_ID NUMBER(3,0) CONGREE_YEAR NUMBER(4,0) WHITEHOUSE_PARTY VARCHAR2(20 BYTE) PRESIDENT_NAME VARCHAR2(20 BYTE) CONGRESS_NAME VARCHAR2(10 BYTE) HOUSE_MAJORITY VARCHAR2(20 BYTE) HOUSE_DEMOCRATS NUMBER(3,0) HOUSE_REPUBLICANS NUMBER(3,0) HOUSE_OTHERS NUMBER(3,0) SENATE_MAJOIRTY VARCHAR2(20 BYTE) SENATE_DEMOCRATS NUMBER(3,0) SENATE_REPUBLICANS NUMBER(3,0) SENATE_OTHERS NUMBER(3,0) FOOTNOTE VARCHAR2(200 BYTE)
  • 9. Step3 - Choose the dimensions that apply to each fact table row • For the business problem under consideration, we can have Political Parties as one of the dimensions, so the fact table and dimension tables are as follows:
  • 10. Step4 - Identify the numeric facts that will populate each fact table row   Once the fact and dimensional tables are in place, it is easy to identify the numeric facts such as which company has the highest stock in which year under which ruling party will become quite obvious. In this scenario, the numeric fact is that the company Allstate Corp, in the trade year 2005 has the maximum high stock of 1197.66 under Democratic Party ruling with congress id 87.  
  • 11. QUERY 2 SELECT d.company_name, sum(s.volume) "Volume" FROM SP500_EOD_STOCK_FACTS s,COMPANY_DIM d WHERE s.TICKER_SYMBOL=d.TICKER_SYMBOL and d.COMPANY_name is not null GROUP BY cube(s.VOLUME), d.COMPANY_name order by "Volume" desc;
  • 12. QUERY 2 OUTPUT COMPANY VOLUME BANK OF AMERICA 465813622 GENERAL ELECTRIC 204452485 MICROSOFT CORP 148263502 PFIZER INC 141891968 E-TRADE 122969972 WELLS FARGO 109991283 CITI BANK 109892271
  • 13. Dimension Table: COMPANY_DIM COLUMN NAME DATATYPE TICKER_SYMBOL (PK) VARCHAR2(10) COMPANY_NAME VARCHAR2(100) COMPANY_LOCATION VARCHAR2(60) COMPANY_ESTABLISHMENT_DATE DATE NOTE VARCHAR2(150)
  • 14. Dimension Table: JULIAN_DAY_DIM COLUMN NAME DATATYPE JULIAN_DAY NUMBER(12) ACTUAL_DATE DATE DAY_NAME VARCHAR2(20 BYTE) DAY_IN_YEAR NUMBER(3) DAY_IN_MONTH NUMBER(3) DAY_IN_WEEK NUMBER(3) MONTH_NAME VARCHAR2(20 BYTE) MONTH_NUM NUMBER(3) YEAR_NAME VARCHAR2(40 BYTE) YEAR_NUM NUMBER(3)
  • 15. Dimension Table: STOCK_EXCHANGE_DIM COLUMN NAME DATATYPE EXCHANGE_ID NUMBER(12) EXCHANGE _DATE DATE EXCHANGE _TIME TIMESTAMP NUM_SHARES_EXCHANGE NUMBER EXCHANGE_QTY VARCHAR2 (20BYTE) EXCHANGE_COUNTRY VARCHAR2 (20BYTE) EXCHANGE_PRICE VARCHAR2(20 BYTE)