Saturday, November 15, 2003

Er huh! My little quest is getting more and more interesting with each passing day. Last Sunday, after my last entry, I went to conceptualising, designing then putting it all to work at my first serious database. It went pretty fine after a few tweaks then I was stuck.

Well, the results of my queries were fine. They give the desired, correct results, but far too many. Some rows were duplicated as many as 6 times. Where I should have gotten merely 5 rows, 48 were churned out.

Was I being too much of a purist in trying to adhere to the rules of normalisation (see previous two posts)? I didn't know then, but I figured there's no reason why normalisation could have caused it if I had known SQL well. Perhaps I've missed something? So I went....

Try this. Stuck. Try that. Stuck. Google this. Stuck. Google that. Stuck. Post it up! (On recommendation from Jack) Stuck.

Thinking that it's just a common problem, I went to consult campmates who studied SQL. None was of my help. One suggested UML. I'm too lazy to learn that.

I was pretty desperate by that time...

One afternoon, I burned an hour of my lunch time designing the database with Microsoft Access, which, I admit was really easy with the GUI (alright, MS got it right but I'm still not buying it) and... *dismayed* it produced the same results as mysql.

It was not just a few minutes ago that I decided to use the distinct keyword which worked! I have been ignoring it for days, thinking that my problem was one that's conceptual. I've never thought that it would be this simple. It's so simple and obvious that I can't googled much out of it. It's a really simple basic keyword, and it just happens to be very powerful, at least in my situation. And that's embarrassing.

Now that this hurdle is cleared, the next will be to try to design an interface to key in and display data easily. That wouldn't be easy but I believe that the apache, mysql and python combination would work.

The only limiting factor is me.