I'm looking to some book/tutorial/sample code that will teach me how
to use SQL to solve some standard problem that goes a bit beyond
using group by and aggregates.
Something like "SQL problem solving" or "SQL design strategies for
selected problems".
My current problem is how to manage discounts in SQL, inside
transactions. Specifically how to "delete" promotions if they are
overlapping, considering I have to display discounted prices on a 1M
article DB and I may have hundreds of promotions running and they
may involve even 10% of the catalogue. But this is just the
beginning.
I bet I'll have different set of problems later.
Online tutorial/howto or reference to Open Source programs that
really exploit SQL (and not python, php, ruby) to deal with discounts
would be very welcome.
eg. I did find very educational to look in the code of GNUMed in the
past.
Actually a reference to some Open Source software that does discount
management at the DB level would be a very good pointer.
And of course I'm using postgresql and even if DB agnostic
techniques will be welcome I don't need to be DB neutral, I'm
working on postgresql.
I skimmed through Celko books and at the moment they seems the
nearest thing to what I'd like to learn even if too much
"theoretical" at the moment. O'Reilly "SQL cookbook" is another
example of the kind of stuff I'm looking for... but the examples are
more like ingredients then recipes.
thanks
--
Ivan Sergio Borgonovo
http://www.webthatworks.it