Family and twin information

Powerpoint slide

Tables

subject

Table contains information information about persons...
id           internal id (not seen by users. used internally in database)
identifier   eutwin id
sex          iso code for sex

group_role

Info about roles of subjects (persons) in groups
subject_id   internal id of subject (key to subject table)
group_id     internal id of group (key to group table)
role         role of a person (identified by subject_id) in group (identif. by group_id)  
             Examples: FATHER, MOTHER, CHILD are possible roles subject can have in 
             family group
             SIBLING is only role subject can have in TWIN or MZTWIN group  

subject_group

Groups of subjects
id           internal id
identifier   unique identifier of group (what ever text...you name it)
type         type of group. Example: FAMILY, TWIN, MZTWIN (group of mz twin sibling)

Example

Family which has triplets of which two are monozygotic

Data (rows) in database:

Subject table (six persons)
-------------------------
id     identifier     sex

1      1000000001     1
2      1000000002     0
3      1000000003     1
4      1000000004     1
5      1000000005     1
6      1000000006     0


Subject group table (three groups)
----------------------------------
id     identifier     type

10     FAMILY__XYZ    FAMILY
11     TWIN_SET_XX    TWIN
12     MZTW_SET_YY    MZTWIN

Group role table
----------------
subject_id   group_id type

1            10       FATHER
2            10       MOTHER
3            10       CHILD
4            10       CHILD
5            10       CHILD  

3            11       SIBLING
4            11       SIBLING
5            11       SIBLING

4            12       SIBLING
5            12       SIBLING