Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Data Mining
Data Warehouse Design
Logical Design
Requirement analysis
Requirement specification
Conceptual design
Logical design
Physical design
Entity-Relationship model
Identify the things of importance (Entities)
The properties of these things (Attributes)
Show how two or more entities are related
(Relationship)
An attribute
a component of an entity that helps define the uniqueness of the
entity
often maps to a column.
A unique identifier is
what is added to tables so that it is possible to differentiate
between the same item when it appears in different places
usually a primary key.
Product Dimension
ProductKey
Time Dimension
TimeKey
Store Dimension
StoreKey
TimeKey (FK)
ProductKey (FK)
StoreKey (FK)
Sale Amount
Time
Key
Product
Key
Stores
Key
Sales
Amount
Rs.1000
Rs.1200
Rs.1500
Product
3
2
1
1
1
2
Store
Time
Product
3
2
1
1
Rs.1000
1
2
Store
Time
Product
3
2
1
1
1
2
Store
Rs.1200
Time
Relational
Database
structured for keyword
searches and building a
query by specifying fields
and perimeters, using SQL
Multi Dimensional
Database
a user simply poses the
question in everyday
verbiage. The user is
helped by the several
online help tools associated
with software programs
such as word processing
and spreadsheet
applications, as well as
several of the more popular
search engines currently in
use
AVG(Temp)
Weather;
AVG()
13
SELECT
FROM
17
...
Syntax
Latitude
Longitude
Altitude
(m)
Temp
07/9/5:1500
20
24
Time
Altitude
(m)
AVG(Temp)
07/9/5:1500
20
22
07/9/5:1500
20
23
07/9/5:1500
100
17
07/9/5:1500
100
17
07/9/9:1500
50
19
07/9/9:1500
50
20
07/9/9:1500
50
21
MAX(Temp)
Suppose:
Day(): time day
Nation(): latitude & longitude name of the country
SELECT
day, nation, MAX(Temp)
FROM
Weather
GROUP BY Day(Time) AS day,
Nation(Latitude, Longitude) AS nation;
day, nation
In standard SQL:
SELECT
FROM
Keyword ALL
{Black, White}
{1994, 1995}
Too many
GROUP BYs and UNIONs!!
Problems with
GROUP BY
GROUP BY cannot directly
construct:
Histograms
Roll-Up Reports
Cross-Tabs
CUBE Operator
Generalize GROUP BY and RollUp and Cross-Tabs!!
CUBE
{Chevy, Ford}
Sample syntax:
Model, Make, Year, SUM(Sales)
SELECT
FROM
Sales
WHERE
Model IN {Chevy, Ford}
AND
Year BETWEEN 1990 AND 1994
GROUP BY CUBE Model, Make, Year
HAVING
SUM(Sales) > 0;
Note: GROUP BY operator repeats aggregate list
in select list
in group by list
ROLLUP Operator
A Subset of CUBE Operator
Return Sales Roll Up by Store by Quarter in 1994.
An Example of ..
By Year
Ch
ev
Fo
rd
y
3D Data Cube
90
9
1
91
19
9
19
2
93
9
1
Re
te
hi
W
Sum
By
Co
lo r
By Make
ue
l
B
&
Ye
ar
By
By Color
ke
a
M
&
r
lo
o
C
Year
Country 2000
2001
2002
2003
AAA
BBB
CCC
35 789
36 789
37 789
38 789