title: how to write and execute a thread
body: <p>I have never worked with threads before, and now I'm trying to create a thread with a query to check database status. The query is as follows:</p>
  
  <p><code>select (*)  as DBCount from v$datafile where status in 'OFFLINE';</code>.</p>
  
  <p>This query returns the total number of all the databases that are offline. Now I want to create a thread in Delphi that will execute this query in the background of my application when I run it and display the results on a label.</p>