Hello, After a year of doing database programming, try to actually normalize. Read a couple online tutorials (phpbuilder, devshed) and the book mysql 2nd edition and it just can't seem to stick. Understanding the concept/theory but freeze up every time I try to implement. Trying to go from 0NF-->3NF (though I can't even really get to 1NF :) ... not worried about 4NF or 5NF.
Currently I have the following 0NF table -------------- ID ------------------------ ID | ColA | ColB | ColC | 1 | A | A.A | A.A.A | 2 | A | A.A | A.A.B | 3 | A | A.B | A.B.A | 4 | A | A.B | A.B.B | 5 | A | A.A | A.A.B | 6 | B | B.A | B.A.A | { ..... repeat ...., values in ColA|ColB|ColC are dependent on each other but arbitrary in assignment .. could pick 1 X | X.M | X.M.X followed by 2 | X | X.M | X.M.X if you really want .. only thing unique is ID} Where: ID(unique)->ColA (one->one) ColA-->ColB (one->Many) ColB-->ColC(one->Many) (basically ColB is a subset of values dependent on the value chosen for ColA and Colc is a subset of values dependent on the value chosen for ColB, ID the only unique value) Now as this goes on and on repeating, will start to see plenty of redundancy in ColA, ColB, ColC (tickets get assigned the same values to ColA, ColB, ColC) and I am lost as where to go from here to be honest. **************************************************************************** ********************** The following is my WRONG attempt to normalize :) For the information allow to be chosen for ColA, ColB, ColC I have additional tables defined ------ ColA ---------- VALUE A B C D ... then a table is created for EACH value in ColA ----A----- (repeat this for B, C, D, ....) VALUE A.A A.B A.C A.D ... and then additional I create a table for EACH value in TABLE A, B, C, ....... ---A.A----- (repeat for all All A.A, A.B... to include B.A, B.B..., arb_value.sub_value...... VALUE A.A.A A.A.B A.A.C Form based and not pretty :) basically: SELECT value FROM ColA List values Choose ColA_value SELECT value FROM $ColA_value #var holding table name for subset of A List ColA_value Choose ColA_value_sub SELECT value FROM $ColA_value_sub #var holding table name from subset of A.A List ColA_value_sub Choose ColA_value_sub_sub INSERT INTO id(ColA, ColB, ColC) VALUES (ColA_value, ColA_value_sub, ColA_value_sub_sub) This only works since I have about 20 tables .... I am pretty sure this is wrong ... might as well use flat text files if I am going to do it this way. **************************************************************************** ***************************** Anybody want to help walk me through this or point to any GOOD FULL EXAMPLES of normalizing a database. Cheers, -Peter ################################## Peter Thoenen - Systems Programmer Commercial Communications Camp Bondsteel, Kosovo ################################## "Stumbled Upon"...heh (Score:5, Funny) /. by $carab on 23:00 23 August 2002 (#4131637) "ForensicTec officials said they stumbled upon the military networks about two months ago, while checking on network security for a private-sector client." Someone new to a Dvorak probably tried to type in "lynx http://www.google.com" but instead got "nmap -v -p 1-1024 -sS -P0 army.mil -T paranoid". --------------------------------------------------------------------- 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 <mysql-unsubscribe-##L=##[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php