Question: Write the SQL code for each query using the prompt and ERD below. A. List the name and year founded for all charities founded on

Write the SQL code for each query using the prompt and ERD below.

Write the SQL code for each query using the prompt and ERD

A.

List the name and year founded for all charities founded on or after 2005. Show your results from the oldest year founded to the newest charity.

B.

Please retrieve all columns from the donations table for any large donations to either Feed the Children or Habitat for Humanity. A donation of $1,000 or more is considered large.

C.

The Name, Address, City, State, and Zip of all Donors that live in Salem, Virginia.

D.

Provide a non-repeating list of the cities the donors are from.

E.

A list of all the charities and the total amount donated to each. Make sure your first column is named CHARITY and your second column is named TOTALDONATIONS.

F.

A four column list with the charity name the average donation size, and the total donated, and the number of donations but only for those charities that have had MORE THAN 3 donations. Your column names should be: Charity, AvgDonation, TotalDonated, and NumOfDonations. Please place your results in descending order by number of donations.

G.

The donor id, gift date, and amount for all gifts given to Habitat for Humanity. Place the results in order from the largest gift down to the smallest gift.

H.

The charity name, number of gifts (renamed to GIFTS), total amount of gifts (renamed to TOTAL), smallest gift (renamed to SMALLEST), and largest gift (renamed to LARGEST), and average gift size (renamed to AVERAGE). Order your results from the charity with the highest average gift size to the charity with the lowest average gift size.

I.

Just the donations table columns for all those donations of $1000 or more made to Feed the Children or Habitat for Humanity.

J.

Retrieve the charity name and the number of donations for any charity that has received more than three donations. Order your solution from the charity with the greatest number of donations to the charity with the least number of donations.

Donors Donations PK DonorlD Charities PK Name OH Founded Phone PK DonationID Name Address HO- City State Zip Phone OFK2 Donorld FK1 Charity Gift Date Amount

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!