Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assume that a single person may have any number of loans ( including zero ) , and a loan must be paid in full on
Assume that a single person may have any number of loans including zero and a loan must be paid in full on
the stipulated end date.
What will the following query return?
SELECT
ppersonid
pfullname,
SUMCASE WHEN enddate CURRENTDATE THEN amount ELSE END AS total
FROM people p
JOIN loans ON ppersonid personid AND ispaidout FALSE
GROUP BY ppersonid pfullname
The list of people who have only remaining payments with the sum of their remaining payments.
The list of people who have only overdue payments with the sum of their overdue payments.
The list of people who have overdue andor remaining payments with the sum of their overdue
payments.
The list of all people with the sum of their remaining payments.
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