The columns in a Customer table are defined as:
acctid INTEGER NOT NULL
acctnm VARCHAR(50)
and the columns in a Trans table are defined as:
acctid INTEGER NOT NULL
amount DECIMAL(8, 2) NOT NULL
The values (where ? indicates NULL) for these columns are the following:
Customer table Trans table
acctid acctnm__ acctid amount
227638 Martin 220532 55.38
220794 Miko 227638 21.73
228326 Nelly 220794 34.14
224753 ? 228326 42.88
216893 Jackie 223961 20.74
220794 15.47
227638 25.64
228326 47.21
The values in the amount column need to be presented in a report so that the column values look like the following:
amount
47.21
42.88
34.14
25.64
21.73
15.47
?
?
Which query provides the desired result?
- SELECT amount
FROM Customer a LEFT JOIN Trans b
ON a.acctid = b.acctid
ORDER BY 1 DESC; - SELECT amount
FROM Customer a LEFT JOIN Trans b
WHERE a.acctid = b.acctid
ORDER BY 1 DESC; - SELECT amount
FROM Customer a RIGHT OUTER JOIN Trans b
WHERE a.acctid = b.acctid
ORDER BY 1 DESC; - SELECT amount
FROM Customer a
Trans b
ON a.acctid = b.acctid
ORDER BY 1 DESC;
Reveal Solution Next Question