Generate five relevant fact queries from the data warehouse

Generate five relevant fact queries from the data warehouse you\'ve developed. For example, you can try to answer the question \"Who is the person who sold most products last year?\".

For the SalesTimeKey, you can directly insert values such as 20160403 representing 3rd April 2016.

http://www.codeproject.com/Articles/652108/Create-First-Data-WareHouse

The link works if you copy and paste it.

Solution

Who is the person who sold most products last year?

Select count(*) ProductID, SalesPersonID from FactProductSales

Where SalesDateKey like ‘2015%’

Group by ProductID, SalesPersonID;

You will get to know who sold most of the products from this query.

How many customers do the store has ?

Select count(*) CustomerID from FactProductSales;

This will fetch you the total no. of counts of customers the store has got.

How many sales man works for this store ?

Select distinct count(*) SalesPersonID from FactProductSales;

This will fetch you the total no. of salesperson the store has got.

How much amount the store has earned till date by selling their products ?

Select sum(SalesTotalCost) “Total Sale till Date” from FactProductSales;

How many total transaction has been done till date ?

Select distinct count(*) TransactionID from FactProductSales;

Distinct is used so that same transactionId cannot be taken into consideration twice. We use DISTINCT keyword to avoid duplicacy.

Hope this helps :). Let me know if you have any more concern on this.

Generate five relevant fact queries from the data warehouse you\'ve developed. For example, you can try to answer the question \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site