From: Martijn Tonies Date: November 14 2008 3:44pm Subject: Re: normalised designs: customer database List-Archive: http://lists.mysql.com/mysql/215212 Message-Id: <020c01c9466f$e0282010$9902a8c0@martijnws> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit > >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