The following questions refer to the Art Course database (the same one used for
ID: 3712575 • Letter: T
Question
The following questions refer to the Art Course database (the same one used for last week module 3 assignment). You can obtain a copy of this data in the Access 2010 database, Art_Course_Database.accdb located on the course Canvas Web site (Listed in Module 3 above). The database contains data shown in Figure 1-10. CUSTOMER (CustomerNumber, CustomerName, Phone) COURSE (CourseNumber, Course, CourseDate, Fee) ENROLLMENT (CustomerNumber, CourseNumber, AmountPaid) wher CustomerNumber in ENROLLMENT must exist in CustomerNumber in CUSTOMER CourseNumber in ENROLLMENT must exist in CourseNumber in Write SQL queries to produce the following results 1) List all students and courses they are registered for. Include, in this order, CustomerNumber, CustomerName, Phone, CourseNumber, and AmountPaid 2) List the total amount paid for each course starting after July 4, 2009. Include in this order, CourseNumber, CourseName, and total amount paid for that course 3) List the average amount paid for each customer. Include, in this order, CustomerName and average amount paid by that customer 4) List all students registered in the Adv. Pastels starting on October 1, 2009. Include, in this order, CourseName, CourseDate, Fee, CustomerName, and PhoneExplanation / Answer
Following is the answer:
SELECT C.CourseNumber,C.Course, Sum(E.AmountPaid) AS TotalAmount
FROM Course AS C INNER JOIN Enrollment AS E ON C.CourseNumber = E.CourseNumber
GROUP BY C.CourseNumber, C.Course
HAVING C.CourseDate >= '04/07/2009'
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.