Initial commit of SQL query to extract data