How do you render a table within a custom module in drupal?
Here's a tutorial which should answer your question:
https://www.drupal.org/node/156863

It's difficult to say much about the way you're querying the database without knowing more about how your data is stored. I will say that you might benefit from defining an Entity type for your achievements.

When it comes to rendering the table you should be returning the output of the 'theme' function, passing 'table' as the first arg, then the header and rows as the second and third:

return theme('table', $header, $rows);


The API page for your version of Drupal will tell you how to structure those variables:
https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7