Sunday, February 19, 2012

I need help normalizing this table.

So I'm creating an administrative back end for a site that's already been created, and whoever made the tables the site uses didn't know much about database design. So I need to normalize this table of Links so it can be easier to have someone make changes and updates to it, but then I need to put all my normalized tables back together to create a View exactly like the old table which the old site can select from. Basically the stipulation is I can't change the code for the old site so I have to make it think it's still selecting from the same table with the same type of parameters. Is it worth doing all this? Or should I just tough it out with this really ugly table?
Here's the table:

and here's the site that uses this table:
http://waahp.byu.edu/links.asp
Thanks!
~Cattrah~
You'll have to explain what the data is. E.g. Can there be duplicates in any of that lot? So canwww.aacp.org be in there twice? Where do these OrderWith values come from? Are there any existing constraints on the table?
|||there are no constraits except that the ID column is the auto generated primary key. Any links are allowed to be in there multiple times, although it really doesn't make much sense to do so. The whole context of the table is to generate a list of website links, as seen in the link below the table image. Most links have a Section(which does not have a URL), which under each section are the weblinks corresponding to it. There are also two special types of links, email links, which can also appear under a Section or be on their own, and Links that appear at the top. IE they will just be listed at the top of the page reguardless if its under a section or not, if it does have a section, it will also appear there. descriptions will appear to the right of all links except email links in which case it will appear to the left. Sections should not have descriptions. OrderWith is a pretty worthless column the way it stands, it defines the order in which the items are selected from the database, in this case alphabetical. With the first links in which the OrderWith is numbered, changing the numbering would change the order that the links appear on the page. In the other cases if you wanted two links under a section to be ordered non alphabetically, you could order them with numbers or just change the order with values to cause them to order a different way.
That's really the whole thing, if you look at the old site, it makes more sense.
~Cattrah~|||Looks like a lot of SQL for one Page of links.
I would not normalize it: There is content and layout information in the DB and the result is a page that looks more like a static HTML file.
If you realy need to touch it I would try to convince my customer to use a simple Category-Link Relation or enter HTML with a Richtextbox.
But I guess this is not an option for you...
regards
Mathias

No comments:

Post a Comment