Skip to content

Instantly share code, notes, and snippets.

@dankor
Created July 8, 2016 14:18
Show Gist options
  • Save dankor/975549b65cb5c6e22d20bf3e0ef3cf3a to your computer and use it in GitHub Desktop.
Save dankor/975549b65cb5c6e22d20bf3e0ef3cf3a to your computer and use it in GitHub Desktop.
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