Re: Other or not? (again)

From: Tony Andrews <andrewst_at_onetel.com>
Date: 8 Sep 2004 05:17:46 -0700
Message-ID: <chmt9a$svu_at_odak26.prod.google.com>



Felix E. Klee wrote:
> Hi,
>
> first note that I already posted the following text on comp.databases
> but got no reply.
>
> I wonder how to set up a table that stores certificates of persons.
>
> PERSON_CERTIFICATES
> person_certificate_id (PK)
> person_id (FK)
> certificate_id (FK)
>
> PERSON_CERTIFICATE_TYPES
> person_certificate_type_id (PK)
> person_certificate_id (FK)
> certificate_type: A type of certificate that a person can possess.
> Examples: "MSc", "Driver's license", "Highschool diploma".

It's hard to address your questions, because your database design doesn't seem to make sense (to me). How can the PERSON_CERTIFICATE_TYPES table define certificate types and yet have a foreign key to PERSON_CERTIFICATES, which in turn links to a specific PERSON? It all seems to be backwards to me. I would expect something more like:

CREATE TABLE certificate_types
( certificate_type_id ... PRIMARY KEY
, certificate_type_desc ...
);

CREATE TABLE certificates
( certificate_id ... PRIMARY KEY
, certificate_type_id ... REFERENCES certificate_types , person_id REFERENCES persons
); Received on Wed Sep 08 2004 - 14:17:46 CEST

Original text of this message