Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Psql help? image text in transcribed
image text in transcribed
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

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

Expert Performance Indexing In SQL Server

Authors: Jason Strate, Grant Fritchey

2nd Edition

1484211189, 9781484211182

More Books

Students also viewed these Databases questions

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago