Auf Thema antworten

also ich würde es als SQL in etwa so machen, stark vereinfacht. nur notwendigste Attribute zur Darstellung:


[code]

postgres=# create table hersteller (id int primary key, name text);

CREATE TABLE

postgres=# create table typen (id int primary key, name text);

CREATE TABLE

postgres=# create table krankenhaus (id int primary key, name text);

CREATE TABLE

postgres=# create table patient (id int primary key, name text);

CREATE TABLE

postgres=# create table ohren (id int primary key, patient int references patient, ohr text, krankenhaus int references krankenhaus, typ int references typen, hersteller int references hersteller, check (ohr in ('rechts','links')));

CREATE TABLE

postgres=#

[/code]


Das ist flexibel genug, später noch neuere Typen und weitere Hersteller aufzunehmen.


Zurück
Oben