Yes, there's the wpdb class. Some examples can be found for e.g. here.
Then there's the global $wpdb object that contains results and other parts, set based on the current routing.
You can also utilize the WP_Query class which is more common. There's a default global $wp_query object and the $wp_the_query(?) intermediary object, that holds the default ...
do_shortcode() returns the content you pass it with the shortcodes, if any, filtered out (ie, processed).
So the code you've posted in your question won't work the way you want it to:
do_shortcode( get_the_title() );
'<h2><a href="%s" title="%s">%s</a></h2>',