Looks okay to me except table teach_classes should have a unique id for each record.
teach_clases (taught_id, class_id, teach_id) Over the long term, the same class probably will be taught more than once and the same teacher probably will teach more than one class so neither class_id nor teach_id would remain unique in the table for classes taught. ----- Original Message ----- From: César L. Aracena <[EMAIL PROTECTED]> To: MySQL General <[EMAIL PROTECTED]> Sent: Monday, June 10, 2002 8:23 PM Subject: Here's something Hi all. This is my first post here, so please be patient with me. I don't know if there's a program already made that does what I need, so I don't have to "reinvent the wheel". I'm using PHP & MySQL to make most of the web sites and web-based Corporate Intranet's programs. What I need now, is to make a program that can keep track of a social club affiliates and their monthly payments. Also keep track of the teachers and classes hours. Because I'm taking my first steps into RDBM's, I would appreciate very much all the help I can get in order to create the perfect DB structure. What I have in mind, is something like this: Table users (user_id, affil_number, last_name, first_name, etc.) Table teachers (teach_id, last_name, first_name, etc.) Table classes (class_id, name, hours) Table teach_clases (class_id, teach_id) Table payments (payment_id, user_id, month, year, main_fee, class1_fee, class2_fee, etc.) What I need to do is show, as an example, the total payments made by affiliate # 0345 in the last 12 months. Other example would be to show all the persons who hasn't paid last month fee. Is what I'm thinking correct or should I consider doing some other table or perhaps changing one that's already made? Thanks in advance, Cesar Aracena [EMAIL PROTECTED] CE / MCSE+I Neuquen, Argentina +54.299.6356688 +54.299.4466621 --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php