| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Other or not? (again)
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 - 07:17:46 CDT
![]() |
![]() |