Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

3) Write SQL to return only the DISTINCT values of the rounded amount of every p

ID: 3746554 • Letter: 3

Question

3) Write SQL to return only the DISTINCT values of the rounded amount of every payment in the PAYMENT table, after being multipled by a tax of 17.25% (the tax should be added to the original amount), ordered by the amount (ascending). You will need to use one SQL function to help you with this. Output should look like:

1

2

4

5

etc.

4) Write SQL to return the lowercased e-mail address, uppercased street address, and uppercased district for every customer in the database. You will need to join at least two tables together and will need to use a couple of SQL functions.

Explanation / Answer

Answer 3)

Select distinct round(pa.amount,2) * 1.1725

from Payment pa

order by pa.amount asc;

Output :

123.75

186.76

218.40

Answer4)

Select lower(cust.email), upper(addr.street), upper(addr.district)

from customer cust inner join address addr

on cust.cust_id=addr.cust_id;

Output:

say@km.tv YORT STREET HATHWAY
vim@sun.tv ARISTRO LANE YORKSHIRE
kim@pre.io YADDAS STREET HATHWAY

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote