Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Recommended Textbook for

More Books

Students also viewed these Databases questions