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:

`select (*) as DBCount from v$datafile where status in 'OFFLINE';`.

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.