In: Computer Science
Use adventure works 2014 database to solve the following questions in SQL management studio.
1. Create a stored procedure that will receive parameters (all non-nullable fields should be supplied except the primary key which should be auto created still) to add a customer, single email, and single phone. The procedure should run it's code in a transaction and if any part of the add fails then the transaction should rollback.
2. Provide this query from previous assignments written with an isolation level that won't see your procedure transaction above until it's complete. Using joins List the orders customer name, order status, date ordered, count of items on the order, and average quantity ordered where the count of items on the order is greater than 300.
the data tables for second question are: sales.customer, sales.salesOrderHeader, Person.Person, sales.salesOrderDetail
***********************************************************************************************************************************
In case of any doubt do ask in the comment section