Hi Alexander--
I see folks have already answered your question. However, I would like to
mention why what you're doing is not-so-great.
How would you search your current db for a person? You have to Union all
the tables together to do what would otherwise be a simple search, or fire
off four SELECT statements. Both are not optimal because if you add a
fifth kind of person you have to change code and SQL statements all over
the place.
With everything in one table (and perhaps additional tables for person-type
specific data), searching your DB on fields common to all people (name,
number of years employed by the company, etc., for example) is easier on
the database (no UNION or pounding the DB with SELECTs), and code only has
to be added to handle new types of people if it is required. The vast
majority of your existing code and the SQL statements will remain the same
in the future.
Hope this helps,
Doug
At 08:26 PM 9/7/01 +0000, Alexander Deruwe wrote:
>Hey all,
>
>I have 4 database tables, that each describe some sort of 'person'
>(transporting company, truck-driver, ..) and have almost exactly the same
>fields.
>Is this the best way of storing this, or does this make more sense:
>
[--snip--]
--Doug's Signature File----------------------------------------
~ ~ ~ I'm proud to work for GLISnet, Michigan's best ISP ~ ~ ~
--1.888.445.4763---8am to 8pm every day-- http://www.glis.net -
The views and opinions expressed in this email are my
own and may not be those of my employer.
# # # # Ghosthunter? http://groups.yahoo.com/group/mmsm # # # #
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]