Menu

[Solved]Job Write Function Take Customer Information 1 Input Create User Save Address Credit Card Q37129073

Your job is to write a function that will take customerinformation [1] as input, create a user, save their address andcredit card information, and save their order [2] into thedatabase. To make sure that the user doesn’t already exist (meaninghe’s a first-timer) or that we are not buying a product that doesnot exist in the database, before doing any inserts, check whetherwe have a user with the provided email and if all product IDs thatwere provided exist in the database. Throw an exception if a userwith the supplied email already exists or some product ID doesn’texist in our database. Lastly, the function will return all theinformation [3] that needs to be shown on the screen describedabove [4] . [1] By customer information, we mean customer email,address, credit card information and all other information you havein your customer/address/credit_card tables. [2] By this we meaninsert the order, the total amount based on all the products boughtwithin the order (x quantity) and the products of the order. [3]The result should be a table containing all the information that’spresented on the screen above. It’s the job of the front enddevelopers to present it on the screen properly. [4] Think of aselect query. It’s ok to have repeated data in the returnedtable.

Use PostgreSQL

Expert Answer


Answer to Your job is to write a function that will take customer information [1] as input, create a user, save their address and … . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *