Add SQL query to generate Excel spreadsheet. Fixes #4