Forum Moderators: open

Message Too Old, No Replies

Databases: Merging and Verifying Into The Same Table

         

database

6:52 am on Jun 1, 2009 (gmt 0)

10+ Year Member



If i hav a table named occupant (FirstName, LastName, Age, Contact, Marital status, Nationality) & visitor table (FirstName, LastName, Age, Contact).

is it advisable for me to merge them into the same table? If yes, How do i verify whether they are visitors or occupants?

LifeinAsia

3:48 pm on Jun 1, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Welcome to Webmaster World!

is it advisable for me to merge them into the same table?

It depends on how you're going to use the data.
If yes, How do i verify whether they are visitors or occupants?

It all depends on how you are distinguishing between occupant and visitor. If you mean, "How do I distinguish them in the database?" then you can add another field to differentiate them.

database

2:44 am on Jun 2, 2009 (gmt 0)

10+ Year Member



1 more question. if i add another field into the table to differentiate them, should that field be my primary key or other fields?

LifeinAsia

4:18 pm on Jun 2, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



It can't be a primary key, since by definition primary key values are unique.

I would, however, most likely index that field.

database

2:41 am on Jun 8, 2009 (gmt 0)

10+ Year Member



thanks for your help =)