Tables with a shared primary key

What term describes the relationship between tables that have a common primary key?

Here is an example:

Table 1
property (property_id, property_location, property_price, ...);

Table 2
flat (property_id, flat_floor, flat_bedroom_count, ...);

+3
source share
6 answers

, . , flat property, property flat, . - - ( , flat property) .

+5

, Supertype/Subtype. , (), , (), .

, Person (), , , Name. Employee (), , , . , . PersonID, , , Person.

Google " " . .

+4

( ). , "" . " ", , "" .

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

, , , property_id PK property_id PK, FK .

+1

" "?

0

" " " " . ( , , - .)

, , " ", " ", , , . , , , , , .

0

( .)

" "... ? ""

: 1 , 2 . , [] , [s], . .

, " " " ", , , " " " ", , , , .

"Can you give an example with two tables with shared primary keys, where one table will not contain all the key values ​​that appear in another?" "

Table 1: column A of type integer, primary key A Table 2: column A of type integer, primary key A

Rows in table 1: {A: 1}. Satisfies the primary key for table1. Rows in table 2: {A: 2}. Satisfies the primary key for table2.

I am convinced?

0
source

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


All Articles