The database consists of three tables CUSTOMER- Keeps track of Customers for the
ID: 3590193 • Letter: T
Question
The database consists of three tables
CUSTOMER- Keeps track of Customers for the art school
COURSE-Keeps track of the Courses offered by the art school
ENROLLMENT-Keeps track of enrollment in terms of customer, course and amount paid
Write an SQL statement that shows the Course, CourseDate and Fees for courses that start with the characters ‘Adv’. Save this as Query 8
Write an SQL statement that shows the CustomerLastName, CustomerFirstName for customers who have a missing/null value for phone. Save this as Query 9
Write an SQL statement that shows the count of how many customers are enrolled in courses as EnrollmentNumber, the minimum amount paid as MinAmtPaid, the maximum amount paid as MaxAmtPaid and the total sum of amount paid as SumAmtPaid. Save this query as Query 10
Write an SQL statement that shows the CourseNumber and the number of times the course has been offered as NumberCourseOffered. Save this query as Query 11
Write an SQL Subquery that will show CustomerFirstName, CustomerLastName and Phone for customers who have enrolled in courses but made a zero payment. Save this query as Query 12
Write an SQL statement that will show CustomerFirstName, CustomerLastName, Phone and CourseNumber for customers who have enrolled in courses but made a zero payment. Save this query as Query 13
Write an SQL statement that will show CustomerFirstName, CustomerLastName, Phone, CourseNumber, CourseName for customers who have enrolled in courses but made a zero payment. Save this query as Query 14
Write an SQL statement that will show CustomerFirstName, CustomerLastName and total amount paid for all courses as TotalPaid. Save this query as Query15
Explanation / Answer
Query 8:-
select Courseid,CourseDate, Fees from COURSE where CourseName like 'Adv%';
Query 9:-
select CustomerLastName, CustomerFirstName from CUSTOMER where Phone=NULL;
Query 10:-
select count(Customerid), MIN(Amount) as MinAmtPaid,MAX(Amount) as MaxAmtPaid, SUM(Amount) as SumAmtPaid from ENROLLMENT;
Query 11:-
select CourseNumber,count(CourseNumber) from COURSE group by CourseNumber;
As per CHEGG policy I am allowed to answer only 4 questions . Hope u understand
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.