utahcon Posted November 24, 2003 Posted November 24, 2003 I am working on importing some feeds into the DB. I noticed that categories and categories_description are two seperate tables in the DB. Is there a reason for this as the information (as far as I could see) could easily all be on the same table. I am asking because I am seriously considering merging these two tables as to make it easier for the intergration of my feeds. Thanks for any information.
wizardsandwars Posted November 24, 2003 Posted November 24, 2003 It's called 'Normalization'. In this case, repeditive values, and trasient dependancies are moved int oa seperate table to achieve 3rd normal form. Essentailly, this will make updates and deletions from this table easier. ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.
eHo Posted November 24, 2003 Posted November 24, 2003 Just off the top of my head I believe they are seperated because you should never store all of your data in one table. I don't know if you are familiar with database design but when I am working with MS Access I split my tables up. I assign a primary to each one and link them together with a foreign key. I do that so if I have to change anything it is easier to hit up the children & not the parents. I doubt this was much help to you but I thought I would throw in my 1-1/2 cents (work is slow today).
utahcon Posted November 24, 2003 Author Posted November 24, 2003 How does this make updating/deleting the table easier? Wouldnt it be easier if you only had to adjust the one table. My real concern here is it is going to be REALLY hard for me to change this? Or is this like a two lines of code in the cart that I can change?
wizardsandwars Posted November 24, 2003 Posted November 24, 2003 For more information regarding normalization, and the benifits of cascading updates and deletions, you may want to do a little research on the subject. Needless to say, there is far more to it than I'm interested in posting here. As for the change you want to make, you'll need to search through every single file of OSCommerce, and find each and every single SQL query that addresses the table you wish to do away with, and alter the query to reflect the change you'd like to make. My guess is you'd find more than 10 queries, but less than 100 in all of OSCommerce that you'd need to change. ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.
utahcon Posted November 24, 2003 Author Posted November 24, 2003 That is what I wanted to know. Thanks
Recommended Posts
Archived
This topic is now archived and is closed to further replies.