Re: Foreign Keys Question

From: Date: Thu, 11 Dec 2008 18:46:35 +0000
Subject: Re: Foreign Keys Question
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-284491@lists.php.net to get a copy of this message
At 12:29 PM -0600 12/11/08, phphelp -- kbk wrote:
Hey tedd --- Do I understand your structure correctly that you have something like: Courses (table) course_id, subject_id, student1_id, student2_id, student3_id, student4_id, <etc.> Is that right? Ken
Ken: That was right, but I think I've reconsidered. You see, Richard pointed out the error of my ways, namely: Student table has student data and ID -- as may records as there are students. Instructor table has instructor data and ID -- as may records as there are instructors. Course table has course data, ID and Instructor ID and Student ID -- but the number of records vary. While there will be only one record per Instructor and one pre Student, the Course table can have up to four records for each course depending upon actuall attendance. I think that makes more sense. As for my "Foreign Keys Question", I think the answer is that it enforces rules upon the configuration (i.e., deleting, altering, and such), but does not provide any significant service beyond that. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com

« previous php.general (#284491) next »