Psql help?
1. Create a user-defined function (UDF) called usd2cand that converts US Dollars (USD) to Canadian Dollars (Cand). Use a conversion factor of 1 Dollar to 1.10 Cand. Please Invoke the function created to test it and show both your script/statement and out for submission. 2. Use the function created in previous question to search for prices in Canadian dollars for the zip code of 95746 for home prices that are less than $500,000. Display zip code information as well as converted price and original price as USD_price 3. Using the listing database from previous lab activities, create a function to help you show your client an anticipate listing price increase of 15% over the summer to every house listed in your zip code. Since you are writing to the listings, you may first need to create a backup table by copying your listings table data to another table using a simple command; such create table listings1 as select from listings so you can write to the backup table 4. Use your price_increase function previously created and pass it right or appropriate parameter (price amount) to show the estimated 15% of price increase in your zip code over the summer to perform the followings 4 (a) Display the original price, address, and your new anticipated price increase Since the update statement inside the function does not return anything, data will be updated in the table but not returned on the screen. If you keep running your solution in question #4, it will update the table each time is ran but wil return nothing to the screen. If you want to display something to the screen, then look at the following option for Question #4 4 (b) Solve question #3 using the select statement to display data on the screen as follows 4 (c) Then use Question #4, to just call or invoke the same function 1. Create a user-defined function (UDF) called usd2cand that converts US Dollars (USD) to Canadian Dollars (Cand). Use a conversion factor of 1 Dollar to 1.10 Cand. Please Invoke the function created to test it and show both your script/statement and out for submission. 2. Use the function created in previous question to search for prices in Canadian dollars for the zip code of 95746 for home prices that are less than $500,000. Display zip code information as well as converted price and original price as USD_price 3. Using the listing database from previous lab activities, create a function to help you show your client an anticipate listing price increase of 15% over the summer to every house listed in your zip code. Since you are writing to the listings, you may first need to create a backup table by copying your listings table data to another table using a simple command; such create table listings1 as select from listings so you can write to the backup table 4. Use your price_increase function previously created and pass it right or appropriate parameter (price amount) to show the estimated 15% of price increase in your zip code over the summer to perform the followings 4 (a) Display the original price, address, and your new anticipated price increase Since the update statement inside the function does not return anything, data will be updated in the table but not returned on the screen. If you keep running your solution in question #4, it will update the table each time is ran but wil return nothing to the screen. If you want to display something to the screen, then look at the following option for Question #4 4 (b) Solve question #3 using the select statement to display data on the screen as follows 4 (c) Then use Question #4, to just call or invoke the same function