I'm presently doing a bit of type of confirming system.the figures, tables, graphs are in line with the consequence of queries. in some way i've found that complex queries aren't simple to maintain, particularly when you will find lots of blocking. this will make the query very lengthy and never clear to see. As well as, sometimes, queries concentrating on the same filters are performed, making lots of redundant code, e.g. when i will choose something between '2010-03-10' and '2010-03-15' and also the location is 'US', customer group is "ZZ", i have to rewrite these conditions every time i create a query within this scope. does the dbms (during my situation, mysql) support any "scope/context" to create the coding more maintainable along with the speed faster?

also, it is possible to industrial standard or best practice for creating such programs? i you know what I'm doing is known as data mining, right?

  1. Learn to create sights to get rid of redundant code from queries. http://dev.mysql.com/doc/refman/5.0/en/create-view.html

  2. No, this is not data mining, it's common confirming. Sometimes known as "decision support". The bread and butter of knowledge technology. Ultimately, play old confirming 's the reason we write software. Someone needs information to come to a decision and do something.

    Data mining is a touch more specialized for the reason that the associations aren't easily defined yet. Someone is attempting to uncover the associations to allow them to then write an effective query to take advantage from the relationship they found.

You will not create a very flexible confirming tool if you're hands coding the queries. Whenever a requirement changes you're as much as your neck in tricky code attempting to satisfy it - this way lies madness.

Rather you can start considering a meta-layer above your query infrastructure and producing the sql in reaction to criteria expressed through the user. You can present all of them with some options from for you to generate your queries. Should you give a little of considered to making individuals options extensible you will be on the right path lower the road of the numerous, many BI and confirming items that already exist.

You could also wish to start searching for infrastructure that performs this already, for example Crystal Reports (ingested by Business Objects, ingested by SAP) or Eclipse's BIRT. Based on regardless if you are following a programming exercise or a strategy to your users' confirming problems you may would like to grab an out of the box merchandise that has had hundreds of 1000's of guy many years of development, such among individuals above as well as Cognos (ingested by IBM) or Hyperion (ingested by Oracle).

All the best.