Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

DWM Exp2 33

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

CSL503 Data Warehousing and Mining Lab Sem VII

Roll No.-33
Name – Jess John

EXPERIMENT 2

Title Implementing Dimensions and Fact table for the case study selected in
experiment 1.

Pre requisite Dimension Modeling, Star schemas, SQL

Mapping with CO To define the design principles of data warehousing using dimensional
modeling. (CSL503.1)

Objective To implement dimensions and fact tables in SQL.

Outcome To simulate star schema of a datawarehouse using SQL.

Instructions - The screenshots of tables created should be incorporated.


- The SQL command for creating tables and inserting records into the tables
using SQL.

Delieverables Dimensions and their attributes

Customer:
a) Customer_ID
b) Name
c) Address
d) Contact_details

Transaction:
a) Transaction_id
b) Transaction_type
c) Transaction_status
Account:
a) Account_ID
b) Account_type
c) Account_opening_date
d) Account_closing_date
Time:
a) Time_ID
b) Date
c) Month
d) Quarter
e) Year
Branch:
a) Branch_ID
b) Branch_Name
c) Branch_Address
d) Branch_Manager

Fact table:
a) Customer_id
b) Account_id
c) Time_id
d) Branch_id
e) Transaction_id
f) Transaction_amount

SQL Command for creating dimension table:

CREATE TABLE Customer (


Customer_ID INT PRIMARY KEY,
Name VARCHAR(255),
Address VARCHAR(255),
Contact_details VARCHAR(255)
);

CREATE TABLE Account (


Account_ID INT PRIMARY KEY,
Account_type VARCHAR(50),
Account_opening_date DATE,
Account_closing_date DATE
);

CREATE TABLE Time (


Time_ID INT PRIMARY KEY,
Date DATE,
Month INT,
Quarter INT,
Year INT
);

CREATE TABLE Branch (


Branch_ID INT PRIMARY KEY,
Branch_Name VARCHAR(100),
Branch_Address VARCHAR(255),
Branch_Manager VARCHAR(100)
);

CREATE TABLE Transactionlog (


Transaction_ID INT PRIMARY KEY,
Transaction_type VARCHAR(50),
Transaction_status VARCHAR(50)
);

CREATE TABLE Fact (


Customer_ID INT,
Account_ID INT,
Time_ID INT,
Branch_ID INT,
Transaction_ID INT,
Transaction_amount DECIMAL(10, 2),
FOREIGN KEY (Customer_ID) REFERENCES Customer(Customer_ID),
FOREIGN KEY (Account_ID) REFERENCES Account(Account_ID),
FOREIGN KEY (Time_ID) REFERENCES Time(Time_ID),
FOREIGN KEY (Branch_ID) REFERENCES Branch(Branch_ID)
);

Screenshots:
Conclusion SQL schema was declared and tables were created successfully.

References Paulraj Ponniah, “Data Warehousing: Fundamentals for IT Professionals”,


Wiley
India
http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/10g/r2/owb/
owb10gr2
_gs/owb/lesson3/starandsnowflake.htm

You might also like