1. Write a SQL function that accepts a principal mortgage amount, an annual percentage rate (APR), and the number of years a mortgage will be paid back over. Calculate the associated monthly mortgage payment according to the following annuity formula: ? = ?( ? + (? /((1+?)^? ( −1 )) where: A = Monthly Payment Amount P = Principle (Initial) Mortgage Amount i = APR / 12 = Monthly Interest Rate n = years * 12 = Total Number of Payments Be sure to specify that data types of the input arguments have enough significant digits to account for realistic mortgage amounts (as large as in the millions of dollars) and APRs (down to the sixth decimal place will be sufficient).
1. Write a SQL function that accepts a principal mortgage amount, an annual percentage rate (APR), and the number of years a mortgage will be paid back over. Calculate the associated monthly mortgage payment according to the following annuity formula: ? = ?( ? + (? /((1+?)^? ( −1 )) where: A = Monthly Payment Amount P = Principle (Initial) Mortgage Amount i = APR / 12 = Monthly Interest Rate n = years * 12 = Total Number of Payments Be sure to specify that data types of the input arguments have enough significant digits to account for realistic mortgage amounts (as large as in the millions of dollars) and APRs (down to the sixth decimal place will be sufficient).
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images