SQL question
Budget: $10 – $30 USD
Question: The Data Management team has created a new mailing list in SQL server called MailingList, so that Los Angeles City Option can send a contribution statement to each program participant who has funds in the account named ‘Pool.’
a. The mailing list is supposed to include, on one row per-participant: first and last names; the most recent, valid address; the names of their employers who have contributed funds in the Pool account; and the sum of contributions made to Pool for the participant, by employer.
b. The three employers should be in the ‘Employer 1’, ‘Employer 2’ and ‘Employer 3’ columns, in descending order of the sum of contributions they have made; and the sums of contributions should be in the same order. See the MailingList table excerpt below.
Write a query to check whether MailingList meets all these requirements. (If it turns out not to be correct, you do not need to identify why in this query.)
a. The mailing list is supposed to include, on one row per-participant: first and last names; the most recent, valid address; the names of their employers who have contributed funds in the Pool account; and the sum of contributions made to Pool for the participant, by employer.
b. The three employers should be in the ‘Employer 1’, ‘Employer 2’ and ‘Employer 3’ columns, in descending order of the sum of contributions they have made; and the sums of contributions should be in the same order. See the MailingList table excerpt below.
Write a query to check whether MailingList meets all these requirements. (If it turns out not to be correct, you do not need to identify why in this query.)