What data model models use parameters and results?

In the following table ...:

CREATE TABLE v (
    height int,
    width int,
    depth int,
    volume int,
    PRIMARY KEY (height, width, depth);
)

... it can be used to store input and output functions of the three variables named volume: volume(height, width, depth) = height * width * depth.

What data model am I using here? Is Entity-Attribute-Value?

0
source share
3 answers

You look mathematically oriented. When Codd (Date) introduced the relational model, he (they) changed the existing mathematical language to a new field.

In your case: the value can be a function of three parameters: val = f(h,w,d). "" ( ) : , {h, w, d} . R3. ({h, w, d}) ( ). /SQL. (, , ) UNIQUE , , : , {h, w, d}. , . " " FK ({h, w, d}}: , , ( " " )

EAV - , "", , . ( ) . - .

+2

, EAV. , . , , .

CREATE TABLE v (
    height_cm int not null check (height_cm > 0),
    width_cm int not null check (width_cm > 0),
    depth_cm int not null check (depth_cm > 0),
    volume_cm3 int not null check (volume_cm3 = height_cm * width_cm * depth_cm),
    PRIMARY KEY (height_cm, width_cm, depth_cm)
);

( - , db/XML/XSLT , . , . , , .)

"volume_cm3", 5NF. ( .) "volume_cm3" , ? 5NF?

0

The table V you are displaying is just a table. It has a three-part key and one data column that is completely dependent on the key. The volume is derived using a formula that uses three measures (and possibly some others) that are in the key. Functional Dependence Volume is a three-part key. This is not a pair of attribute values. It also does not violate any normal form. This is just a three-part key view and one data column. You can convince this question.

0
source

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


All Articles