What is the proper way to drop database references for an uninstalled drupal module? I've uninstalled the Commerce Coupon 7.x-2.0-beta3 through the admin ui and removed the corresponding folder from the sites/all/modules directory. Now when I install the previous version of Commerce Coupon 7.x-1.0-beta7 I get hit with the error.

DatabaseSchemaObjectExistsException:
 Table &lt;em class="placeholder"&gt;commerce_coupon&lt;/em&gt; already exists.


When I look at the Database in phpMyAdmin I see the the following references.


commerce_coupon
commerce_coupon_type
field_data_commerce_coupon_order_reference
field_data_commerce_coupon_reference
field_revision_commerce_coupon_order_reference
field_revision_commerce_coupon_reference


I am not very familiar working with tables through SQL. Is there a basic procedure or query that is commonly used for deleting all references to a particular Drupal module?
There's no single procedure for manually removing a module, it kind of depends on what has been installed, where it's been installed and how it's been used.

For commerce coupon the basics are pretty simple:


Remove commerce_coupon and commerce_coupon_type
Remove the 4 field tables.
DELETE FROM field_config_instance WHERE field_name IN ('field_data_commerce_coupon_order_reference', 'field_data_commerce_coupon_reference')
DELETE FROM field_config WHERE field_name IN ('field_data_commerce_coupon_order_reference', 'field_data_commerce_coupon_reference')
Flush the caches


From there it gets a bit trickier. Depending on how the module's been used you may have references to coupons in the commerce_line_item table, with relationships back to their order in field_data_commerce_line_items (and the corresponding revision table). Those should also be removed to prevent errors when line items are loaded.

As you mentioned in the comments there may also be related rules (and potentially views as well), hunting down and deleting those manually might be the easiest thing to do.