difference between querying database and using the loop

There is no absolute better/worse/best/worst implementation. The correct implementation depends on what you’re trying to accomplish.

For a great explanation, I direct you to this post by Digging Into WordPress, which explains the 4 basic means of interacting with the WordPress Loop:

  • Default Loop

    So what makes it “default”? Mostly because it uses the default query to loop through post content, making it the loop used like 99% of the time for most themes. It tells WordPress to loop through posts and display the information according to context

  • Loop with query_posts()

    The query_posts function enables us to modify the [default] query and display our desired results. We can either override the entire query or keep it around and just change a few parameters.

  • Loop with WP_Query()

    Use WP_Query for creating multiple, customized loops. By setting up additional instances of WP_Query in your theme, you can create any number of multiple loops, and customize the output of each.

  • Loop with get_posts()

    Use the get_posts() function to easily create additional, static loops anywhere in your theme. get_posts accepts the same parameters as query_posts, and is perfect for adding static, custom loops to your sidebar, footer, or anywhere else.

Give that post a read; it will help you understand when/how to use each option.

EDIT

p.s. more from Digging Into WordPress: if you use one of these methods to modify the query, you will want to familiarize yourself with when/how to reset the query.