Added sql, tables and new data retrieval