The great SQL query "template" from edition 1 of Data Warehouse Toolkit
2 posters
Page 1 of 1
The great SQL query "template" from edition 1 of Data Warehouse Toolkit
Way back in the first edition of the book, there was a great explanation of how adding columns and group-by to a query is like drilling down. In fact, there was a nice example of a "template" SQL query that accompanied the explanation.
I couldn't find this in the 2nd edition book, and I can't even FIND a 1st edition book!
Does anyone have the text of this short explanation, please?
Thanks...
I couldn't find this in the 2nd edition book, and I can't even FIND a 1st edition book!
Does anyone have the text of this short explanation, please?
Thanks...
cube.head- Posts : 6
Join date : 2009-08-03
Re: The great SQL query "template" from edition 1 of Data Warehouse Toolkit
Not quite sure what you're referring to, but on pg. 44 version 2 is this:
"Drilling down in a data mart is nothing more than adding row headers from the dimension tables. Drilling up is removing row headers. We can drill down or up on attributes from more than one explicit hierarchy and with attributes that are part of no hierarchy."
"Drilling down in a data mart is nothing more than adding row headers from the dimension tables. Drilling up is removing row headers. We can drill down or up on attributes from more than one explicit hierarchy and with attributes that are part of no hierarchy."
BoxesAndLines- Posts : 1212
Join date : 2009-02-03
Location : USA
Re: The great SQL query "template" from edition 1 of Data Warehouse Toolkit
Thanks.. Yep - I see that in the the 2nd edition. The first edition has an expanded explanation that I want to give to my client here. But the book is at home.. Oh well, I'll grab it on the weekend.
cube.head- Posts : 6
Join date : 2009-08-03
Re: The great SQL query "template" from edition 1 of Data Warehouse Toolkit
I managed to locate the book on Amazon: http://amzn.com/0471153370 (this is an Amazon "permalink")
And then by clicking on the "Click to look inside!" I was able to browse various parts of the book. One of the ways you can preview while in this mode is a button called "Surprise Me" that takes you to a random sampling of about 4 pages in the book. Well, incredibly, one of my surprises was landing on page 14, and the topic is: "The Standard Template Query".
Here is the query Ralph used to describe the standard template:
SELECT p.brand, sum(f.dollar), sum(f.units)
FROM salesfact f, product p, time t
WHERE f.prductkey = p.productkey
AND f.timekey = t.timekey
AND t.quarter = ’1Q1995’
GROUP BY p.brand
ORDER BY p.brand
I'll rewrite it to conform to today's JOIN standards:
SELECT p.brand, sum(f.dollar), sum(f.units)
FROM salesfact f
INNER JOIN product p ON f.prductkey = p.productkey
INNER JOIN time t ON f.timekey = t.timekey
WHERE t.quarter = ’1Q1995’
GROUP BY p.brand
ORDER BY p.brand
In this query, brand is a "row header". Adding additional attributes to the SELECT and the GROUP BY "drills down".
And then by clicking on the "Click to look inside!" I was able to browse various parts of the book. One of the ways you can preview while in this mode is a button called "Surprise Me" that takes you to a random sampling of about 4 pages in the book. Well, incredibly, one of my surprises was landing on page 14, and the topic is: "The Standard Template Query".
Here is the query Ralph used to describe the standard template:
SELECT p.brand, sum(f.dollar), sum(f.units)
FROM salesfact f, product p, time t
WHERE f.prductkey = p.productkey
AND f.timekey = t.timekey
AND t.quarter = ’1Q1995’
GROUP BY p.brand
ORDER BY p.brand
I'll rewrite it to conform to today's JOIN standards:
SELECT p.brand, sum(f.dollar), sum(f.units)
FROM salesfact f
INNER JOIN product p ON f.prductkey = p.productkey
INNER JOIN time t ON f.timekey = t.timekey
WHERE t.quarter = ’1Q1995’
GROUP BY p.brand
ORDER BY p.brand
In this query, brand is a "row header". Adding additional attributes to the SELECT and the GROUP BY "drills down".
cube.head- Posts : 6
Join date : 2009-08-03
Similar topics
» Indexing option on numeric fact referred to in DW Toolkit 2nd edition
» data warehouse or not ? when is it okay to use OLAP without a data warehouse database
» Data Dictionary template
» AuditTableProcessing Question from Microsoft Data Warehouse Toolkit. Audit Dimension
» crm issue in The DataWareHouse Toolkit 2nd edition
» data warehouse or not ? when is it okay to use OLAP without a data warehouse database
» Data Dictionary template
» AuditTableProcessing Question from Microsoft Data Warehouse Toolkit. Audit Dimension
» crm issue in The DataWareHouse Toolkit 2nd edition
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum