Kimberlie
2011-02-07 09:58:02 UTC
I have details stored about a person, including all the generic thing such as first name, surname, DOB etc, however details of the persons school, college, university, doctor and employer, will also be stored
The person will be inputting the information themselves, and the data will go into the corresponding tables.
I am having some confusion about what to do. In order to make the tables relational, do I include the attributes of school, college, doctor, etc in the table Person, as well as storing these details as their own tables, e.g. College, Doctor, or am I getting this completely wrong?
Here is my SQL code so far, which currently doesn't work.
CREATE TABLE person (personID int NOT NULL PRIMARY KEY, firstname char(20) NOT NULL, surname char(30) NOT NULL, DOB number(7) NOT NULL, gender char(6) NOT NULL, NInumber varchar(9) NOT NULL, city char(30) NOT NULL, emailAddress varchar(50) NOT NULL, schoolName char(100) REFERENCES school(schoolName) NOT NULL, surgeryName char(50) REFERENCES doctor (surgeryName), educationName char(50) REFERENCES college_uni (educationName), employerName char(30), cityed char(30), contacted number(12), emailAddressed varchar(50), addressline1 varchar(30), addressline2 char(30), postcode varchar(7), convictions char(3) NOT NULL);
Any help appreciated as I am getting very confused.