I would like to suggest you the following projects that contain useful moodle sql queries:
oRestE (http://www.redaelli.org/matteo/blog/projects/oreste-erlang-odbc-rest-services): I use it to expose courses attendances (scorm and facetoface activities) to a SAP HR system .
Moodle-reporting (http://www.redaelli.org/matteo/blog/projects/moodle): some tools & scripts & sql queries using R, Eclipse Birt and RRDtools
Any feedbacks are welcome, please add an issue in the google code project pages
General developer forum
Databases: Useful moodle sql queries (attendances to SAP HR,..)
This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.