Dimension modeling: should a fact table have a foreign key?

Can a fact table have no keys at all? or if possible, is it a good design? If the fact table does not have any dimensions, on what basis is it analyzed?

What if the fact table has only a primary key / s and does not have a foreign key / s?

+3
source share
4 answers

Inaccurate, foreign keys link you to tables that break your fact table into categories and subcategories.

So, if the fact table was

create table stores (id, kindOfStore, sales)

kindOfStore - , , kindOfStore ( , , , store = "Food" "Kind_id = 8". , diminsion,

create table kindOfStore (id, Variety, Specialization, Subspecialization) 

Variety, Specialization Subspecialization .

- , , , , , .

Datawarehouses denormalize ( ) OLTP, , .

+2

Dimemnsional , , , , "" . datawarehousing ( READ), OLTP, ( , , - ).

, , TIME PLACE.

, ( , ).

, , ( , ), ENUM.

, ENUMS.

...

+2

, .

, / . ,

0

, , - , , // .

, , ? : " , , "... .

... ... , , ?

0

Source: https://habr.com/ru/post/1711294/


All Articles