Question: Write a SQL (in PostgresSQL) function that accepts a principal mortgage amount, an annual percentage rate (APR), and the number of years a mortgage will

Write a SQL (in PostgresSQL) 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:

A = P (i + in ) (1+i) 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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!