I\'m helping a friend with a SQL exercise sheet. He needs to compute a sum query (with some intermediate steps) and then output the base table together with