title: Execute a DB query every 30 mins in the database
body: <p>As part of my job I have to periodically check for failed items in the database. I have the query with me. Instead of manually executing the query every now and then I want to execute it in a predefined interval automatically and capture those items in an excel sheet or trigger a mail to certain recipients.
  What is the best way to do it?</p>