From e1785ac40c3b03f63ad9c841ab51725be19cf29a Mon Sep 17 00:00:00 2001 From: Mariusz Sielski Date: Tue, 22 Jan 2019 21:35:15 +0100 Subject: [PATCH] update create and add mappings excel --- mapping.xlsx | Bin 0 -> 8308 bytes sql/create.sql | 11 +++++------ 2 files changed, 5 insertions(+), 6 deletions(-) create mode 100644 mapping.xlsx diff --git a/mapping.xlsx b/mapping.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..5dec118d703c9fb49f6574f9ff8f30b4330b28ee GIT binary patch literal 8308 zcmeHM1zVI`*B+#sp&7b6C8bm8M(OTm=w|3fK)R&6q`M>~1tbJSKNOO>&b}?qj_e63+o- z2%AY&q-P*$u-sHP$J+WKC-M$U;x(QPUmf=3M<1?}ajSX<`zA=lV7nSxbkJ~*rU5Y@ z``e*?+HL}(L>C?HqdZ(%NzZ$pHy0}~=$O;c%Byb~pX-EsWHrR?* zu2U*7yxjXqNoy6zKU(%4YhxN`*2bFA$KY&(RTeIq%I71#yFrl(C+f?~3 zFhk4ZIV00Ys~lkoofs<k9HS%(UxrJ;+t9hjZ%$Mt`7{4eI<-yXd( zQBk>{11;?6*|+fFtGSf~ED3oJ@n`Ln8vcQ@A2Aza3uuT}y6H)c%h1fO=S(WI8|S+(t5Vjm8WlJ8 zHP__RA=HTy$lp+SlB}L>g&e zT&AOZ?0>#S%+#j;VqTsd)-lZMXne^1iU;E}EY3wQb7>SdoHvf$ks!R|_}MrtlF308 z8RRKE4)*@;Uc~__Mg|zCRU~nkB?p)P%QXWnQFuWymDG9bOc=M#1cw`!4S0%l6pER# zhRwj+5cT~kNJDcoMFykA)f230VrI4lslNvJD`yHJ6I|;6dh-w>qC7)&a&2gvruSPpjhtDl8^MdJo&O7 zJHw5R*p^gq0izx7bN6FeBwTMsNVKJ0e6Hmxv5%Lx7498mUbX;CMjD#+8oxN%JM%2Q zxyBN8A`4L;!UY1~2gc>%vm3Hp4Ic6i?i0dTrJgO_@uEJWx3TLXO~>as&=}>f&0WWEs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R#0tqQ~@q&$* zrMM?Wn6WZ){RY?d4G4!FUJgC4TPEr!AH^Y62YxOWCO+M4**>l+4&{S2^j)}Qg<Ytil z3M(}WkH$c|?aB9hU8fJeETl%`7dUdQU7|EbuTPF~UXelDoer0*1aQcSLo`VG%iKZB z@irnT3@x}A2*@Fz)Ck>Zo`Kvg9mH>#C%$q*Tr{g8Z-}mE($%|8MqOtNSLN3lmM(Vd z*bOT0zeiVb&%_x8)V`}fVmla4IBipjgJD^Pb|F!y`{roK1{^jWi+QR-x z!2Q|yXC>}0V@=fGjQ^#}{p{gq`RXqZCeV5d`u9JJSwB1Y`RwqQ13IW226X`b&q?BE z)1Pa%zf9Nh{`2Vns^ot5^3VMGmk$6S7+MhiE8G5T{?7>ccXI&o-^~Armn!n`(A@<9 QP@u0sXhL5l{qgDl0M=MVE&u=k literal 0 HcmV?d00001 diff --git a/sql/create.sql b/sql/create.sql index 00e0614..01e2931 100644 --- a/sql/create.sql +++ b/sql/create.sql @@ -106,7 +106,7 @@ CREATE TABLE dim_countries ( DROP TABLE IF EXISTS dim_claim_statuses; CREATE TABLE dim_claim_statuses ( claim_status_sk INTEGER identity(1, 1) PRIMARY KEY, - status_code_bk VARCHAR(1) NOT NULL, -- A for Accepted, D for Declined, W for Waiting + status_code_bk NVARCHAR(1) NOT NULL, -- A for Accepted, D for Declined, W for Waiting status_description NVARCHAR(50) ); GO @@ -121,8 +121,8 @@ GO DROP TABLE IF EXISTS claim_status_mapping; CREATE TABLE claim_status_mapping ( - status_code_bk VARCHAR(1), - status_code_value VARCHAR(50) + status_code_bk NVARCHAR(1), + status_code_value NVARCHAR(50) ); GO @@ -153,7 +153,7 @@ CREATE TABLE FT_Registration ( --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_fk integer FOREIGN KEY REFERENCES dim_claim_statuses(claim_status_sk) NOT NULL, indication_fk integer FOREIGN KEY REFERENCES dim_indications(indication_sk) NOT NULL, - claim_number NVARCHAR(50), + claim_number VARCHAR(20), -- cnt jest tylko zliczeniowy, będzie miał 1, więc dałbym tinyint cnt tinyint, ); @@ -168,13 +168,12 @@ CREATE TABLE FT_Refund ( response_time_fk integer FOREIGN KEY REFERENCES dim_time(time_sk), -- moze byc null country_fk integer FOREIGN KEY REFERENCES dim_countries(country_sk) NOT NULL, indication_fk integer FOREIGN KEY REFERENCES dim_indications(indication_sk) NOT NULL, - registration_country_fk integer FOREIGN KEY REFERENCES dim_countries(country_sk) NOT NULL, --decimal zjada mniej, niż money, do przedyskutowania (precyzja - liczba miejsc przed i po przecinku, skala - liczba miejsc po przecinku) price money, reimbursement_amountPercent smallint, --tu obliczymy jako iloczyn price * reimbursement_amountPercent reimbursement_amount decimal(9,2), - claim_number integer, + claim_number VARCHAR(20), cnt tinyint, ); GO \ No newline at end of file