Question
Use the following tables below to write query commands Table 1: Year -> columns are: *year#, yeargoal, Table 2 : Gift -> columns are: amount,
Use the following tables below to write query commands
Table 1: Year -> columns are: *year#, yeargoal, Table 2: Gift -> columns are: amount, and Table 3: Donor ->columns are: *donor#, dlname, dfname, dphone, dstate, dcity
1. List the donors who have made a donation every year. -- HINT: Inner join Donor on Gift, aggregate the count of gift.year# by donor (the number of years a donor has donated) -- and use HAVING to limit results to when this count is equal to a sub-query counting Year.year#
2. List the donors whose average donation is more than twice the average donation of all donors. -- HINT: Similar to f. above but average the gift amount for each donor -- and using HAVING to limit results to when this average is greater than a sub-query averaging all gift amounts
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started