You are asking for something we cannot do, we have no knowledge of the DB table names or anything... I would suggest you go to the DB vendor's site on this one and look for things there to help you sort out the SQL syntax for your query there, as given these load statements and QVD files as sources, there is literally no means for anyone in the Community to translate this for you, as we know nothing about the SQL DB and its tables and fields... There is no way to be sure the QVD field names are the field names in the SQL DB, as many times those are aliased on the load from the DB... Hopefully this is making sense.
If you have the SQL tools on your machine to connect to the database(s) in question, generally there is a means to look at the first x rows of a table to see what the fields are etc., that is about the best point in a direction I could give you here. Your best bet is likely to get hold of a DBA and see if they can help you with things, as they will know the DBs and tables etc. and can likely put together a query for you quite quickly. Once you have the SQL query, if you create a Connection string to the DB in our script, you can likely paste that query straight into our script editor and run things as well.
Here is a Help link that may be of a little use, you will have to go to some sub pages etc....
To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question. I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.