1
0
forked from s26450/hurtownia

Zaktualizuj 'sql/create.sql'

This commit is contained in:
s26453 2018-11-27 18:15:18 +00:00
parent 9c407f4e56
commit 14cdb55b25

View File

@ -62,3 +62,47 @@ CREATE TABLE dim_indications (
IndicationDescription NVARCHAR(500) IndicationDescription NVARCHAR(500)
); );
GO GO
--TABELE FAKTÓW
--to by było do SQL Server'a < 2016
--IF OBJECT_ID('dbo.FT1_Registartion') IS NOT NULL DROP TABLE dbo.MyCategories;
DROP TABLE IF EXISTS FT1_Registartion;
CREATE TABLE FT1_Registartion (
id INTEGER identity(1,1) PRIMARY KEY,
expected_response integer,
submission_date integer,
response_time integer,
drug_sk integer,
factory_sk_API integer,
factory_sk_bulk integer,
factory_sk_package integer,
country_sk integer,
--claim status do uspójnienia z tabelą dim_status, wydaje mi się, że można by dodać przedrostek claim do kolumn, będzie czytelniej :)
claim_status_sk integer,
indication_sk integer,
claim number integer,
-- cnt jest tylko zliczeniowy, będzie miał 1, więc dałbym tinyint
cnt tinyint
);
GO
DROP TABLE IF EXISTS FT2_Refund;
CREATE TABLE FT2_Registartion (
id INTEGER identity(1,1) PRIMARY KEY,
claim_status_sk integer,
drug_sk integer,
submission_date integer,
expected_response integer,
country_sk integer,
indication_sk integer,
registration_country integer,
--decimal zjada mniej, niż money, do przedyskutowania (precyzja - liczba miejsc przed i po przecinku, skala - liczba miejsc po przecinku)
price decimal(9,2),
reimbursement_amountPercent smallint,
--tu obliczymy jako iloczyn price * reimbursement_amountPercent
reimbursement_amount decimal(9,2),
);
GO