SQL query has been modified using new columns and tables from the database