In contrib/sqlpanel directory you can find module which enables you direct access to LMS database, based on direct queries. Results are being shown as table, along with execution time. It's also possible to print query results.
Number of instantly displayed records is 50 by default. You can change this limit in sqlpanel_pagelimit variable in section [phpui] of configuration.
Installation is limited to copying needed files into LMS tree: sql.php should be placed into modules directory, and sql.html, sqlprint.html into templates. After those steps are done, you're able to access this module via http://lms.domain.pl/?m=sql.