Even plain text files can be queried using SQL. You only need a proper connector.