Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Database Modeling With Neo4j

Authors: Ajit Singh

2nd Edition

B0BDWT2XLR, 979-8351798783

More Books

Students also viewed these Databases questions