Is there a reason you have to use SQL? What version of ALM/QC are you using? How much do you know about the database schema?
If you must use SQL, you will need to join multiple tables. You will need to study the Database Reference documents to find everything you need. At a high level you need:
TESTCYCL - contains the information you see in the Execution Grid in the Test Lab for a Test Set
CYCLE - contains the information about a Test Set
CYCL_FOLD - contains the information about the Folders of the Test Lab tree
TEST contains the information about the Test Case.
If you must use SQL, you will need to join multiple tables. You will need to study the Database Reference documents to find everything you need. At a high level you need:
TESTCYCL - contains the information you see in the Execution Grid in the Test Lab for a Test Set
CYCLE - contains the information about a Test Set
CYCL_FOLD - contains the information about the Folders of the Test Lab tree
TEST contains the information about the Test Case.