Answered step by step
Verified Expert Solution
Link Copied!

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
p.person_id,
p.full_name,
SUM(CASE WHEN 1.end_date CURRENT_DATE THEN 1.amount ELSE 0 END) AS total
FROM people p
JOIN loans 1 ON p.person_id =1.person_id AND 1.is_paid_out = FALSE
GROUP BY p.person_id, p.full_name
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 and/or remaining payments with the sum of their overdue
payments.
The list of all people with the sum of their remaining payments.
image text in transcribed

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

Students also viewed these Databases questions