information integration sandeep singh balouria cs-257 id- 101

11

Click here to load reader

Upload: calvin-hensley

Post on 18-Jan-2018

219 views

Category:

Documents


0 download

DESCRIPTION

DATA CUBE

TRANSCRIPT

Page 1: INFORMATION INTEGRATION Sandeep Singh Balouria CS-257 ID- 101

INFORMATION INTEGRATION

Sandeep Singh BalouriaCS-257 ID- 101

Page 2: INFORMATION INTEGRATION Sandeep Singh Balouria CS-257 ID- 101

DATA CUBES

Data cube is a multi-dimensional structure , it as a data abstraction that allows one to view aggregated data from a number of perspectives.

It is surrounded by a collection of sub-cubes/cuboids that represent the aggregation of the base cuboid along one or more dimensions.

Page 3: INFORMATION INTEGRATION Sandeep Singh Balouria CS-257 ID- 101

DATA CUBE

Page 4: INFORMATION INTEGRATION Sandeep Singh Balouria CS-257 ID- 101

CUBE OPERATOR

In cube operator, we can define an augmented table CUBE(F) that add an additional value, denoted *, to each dimension.

The * has the intuitive meaning “any”, and it represents aggregation along the dimension in which it appears.

Page 5: INFORMATION INTEGRATION Sandeep Singh Balouria CS-257 ID- 101

CUBE OPERATOR

Page 6: INFORMATION INTEGRATION Sandeep Singh Balouria CS-257 ID- 101

EXAMPLE:Sales(model , color, date, dealer, val , cnt).-In this query we specify conditions on certain attributes

of the sales relation and group by some other attributes

-In the relation CUBE(sales), we look for those tuples t with the following properties:

1. If the query specifies a value v for attribute a, then tuple t has v in its component for a.

Page 7: INFORMATION INTEGRATION Sandeep Singh Balouria CS-257 ID- 101

2.If the query groups by an attribute a, then t has any non-* value in its component for a.

3.If the query neither groups by attribute a nor specifies a value for a, then t has * in its component for a.

QUERY:SELECT color, AVG(price)FROM SalesWHERE model=‘Gobi’GROUP BY color;Cube(Sales) Form is (‘Gobi’ ,c ,*,*,v ,n)

Page 8: INFORMATION INTEGRATION Sandeep Singh Balouria CS-257 ID- 101

CUBE IMPLEMENTED BY MATERIALIZED VIEWS

A materialized view is an object that stores the result of select statement. These are mostly used in data warehousing to improve the performance of the select statements that involve group and aggregate functions we use materialized views .

EXAMPLE: INSERT INTO salesV1 SELECT model, color, month, city, SUM(val) AS val, SUM(cnt) AS

cntFROM sales JOIN Dealers ON dealer=nameGROUP BY model , color , month, city;Sales(model, color, date, dealer, val, cnt)

Page 9: INFORMATION INTEGRATION Sandeep Singh Balouria CS-257 ID- 101

Query:SELECT model ,SUM(val) FROM salesGROUP BY model;-Can also be written as:SELECT model, SUM(val)FROM sales(v1)GROUP BY model;

Page 10: INFORMATION INTEGRATION Sandeep Singh Balouria CS-257 ID- 101

SELECT model, color, date, SUM(val) FROM salesGROUP BY model ,color , date;

Page 11: INFORMATION INTEGRATION Sandeep Singh Balouria CS-257 ID- 101

LATTICE OF VIEWS

In lattice view we can partition the values of a dimension by grouping according to one or more attributes of its dimensional tables.