Database Query before making an api call

Need to have some way of dropping tables in database every hour, I have
no idea how to do that.