Created
July 8, 2016 14:18
-
-
Save dankor/975549b65cb5c6e22d20bf3e0ef3cf3a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create view [dbo].[dim_Product] as | |
select | |
[ID] | |
,[Name] | |
from [Product] | |
CREATE view [dbo].[dim_Client] as | |
select | |
[ID] | |
,[Name] | |
from [Client] | |
create view [dbo].[dim_Date] as | |
select | |
[Day] | |
,[DayName] | |
,[Month] | |
,[MonthName] | |
,[Year] | |
from [Date] | |
create view [dbo].[dim_Invoice] as | |
select | |
[ID] | |
,[Number] | |
from [Invoice_Header] | |
create view [dbo].[dim_Price] as | |
select | |
[Price] | |
from [Invoice_Detail] | |
create view [dbo].[fact_Invoice] as | |
select | |
[Invoice_Detail].[ID] | |
,[Product] | |
,[Date] | |
,[Client] | |
,[Price] | |
,[Amount] | |
,[Qty] | |
from [Invoice_Detail] | |
left join [Invoice_Header] | |
on [Invoice_Detail].[ID] = [Invoice_Header].[ID] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment