Thread: create relationship one-to-one
09-01-12, 05:49 #1Registered User
- Join Date
- Aug 2012
Unanswered: create relationship one-to-one
I am trying create relationship one to one between table PERSON and PESEL
and I went write syntax to creating relation:
CREATE TABLE PESEL(
id_pesel int primary key,
number_pesel varchar(11) not null);
CREATE TABLE PERSON(
id_person int primary key,
name_person varchar(15) not null,
surname_person varchar(20) not null,
id_pesel int not null);
ALTER TABLE PERSON ADD CONSTRAINT FK_PESEL FOREIGN KEY(id_pesel) REFERENCES PESEL(id_pesel)
this is okay?
Last edited by dexter90; 09-01-12 at 06:41.
09-01-12, 11:50 #2Registered User
Provided Answers: 1
- Join Date
- Aug 2003
- Where the Surf Meets the Turf @Del Mar, CA
>I am trying create relationship one to one between table PERSON and PESEL
then in a normalized table design only a SINGLE table would exist.
all data for a single entity would exist within a single row.You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!
For most folks, they don't know, what they don't know.
Good judgement comes from experience. Experience comes from bad judgement.