Add link that performs database function
There are two separate things to take care here, one is dealing with the database table, you will find all the functions you need to use for CRUD operations on databases here.

The other issue is dealing with the table showed on the browser page, if you want to operate with tables your best bet (IMHO) is to use Ctools, install  it and enable the Ctools Ajax example submodule, there you will find exactly what you want, a link that removes the file.

Hope this helps.