> >3) create the customer table with a FK for people and a FK for
> >companies, and decide on the customer type in the application based on
> >the presence of that key
> >
> [JS] I'm not sure why you need a foreign key. Surely you won't be entering
> customers using the MySQL CLI client on a routine basis, so your user
> interface could (and should) be responsible for checking the data.

Ehm, no, if it's possible, put the constraints -on the database- ... Never
ever rely on the application alone to enforce data consistency.

> If you really feel the need to constrain the data, define the column as a
> set.

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Sybase
SQL Anywhere, Oracle & MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to