Question: IN - Class Lab Assignment on MS SQL Advanced Stored Procedures Individual Assignment | 2 . 5 % Warning: Objective: To practice creating stored procedures
INClass Lab Assignment on MS SQL Advanced Stored Procedures
Individual Assignment
Warning:
Objective:
To practice creating stored procedures with error handling and transactions for a retail store
management system. Students will create tables and write stored procedures to handle various
business transactions and generate reports.
Step : Create Tables
Write SQL scripts to create the following tables:
Customers table with columns: CustomerID, FirstName, LastName, Email, Phone
Products table with columns: ProductID, ProductName, Price, Stock
Orders table with columns: OrderID, CustomerID, OrderDate
OrderDetails table with columns: OrderDetailID, OrderID, ProductID, Quantity, Price
CustomerFeedback table with columns: FeedbackID, CustomerID, FeedbackDate,
Comments
Step : Create Stored Procedures
Add a New Customer
a Create a stored procedure AddCustomer that inserts a new customer into
the Customers table. Include error handling and transactions.
Create a New Order
a Create a stored procedure CreateOrder that inserts a new order and its
details into the Orders and OrderDetails tables, respectively. It should also
update the product stock. Include error handling and transactions.
Update Product Details
a Create a stored procedure UpdateProduct that updates the details of an
existing product. Include error handling and transactions.
Generate Sales Report
a Create a stored procedure GenerateSalesReport that generates a sales
report for a given date range.
Submission Instructions:
Complete each task and create the stored procedures as outlined.
Test each stored procedure to ensure it works correctly and handles errors appropriately.
Submit a single SQL script file containing all your stored procedures.
Include a screenshot of the output for each stored procedure as evidence of
successful execution.
INClass Lab Assignment on MS SQL Advanced Stored Procedures
Individual Assignment
Evaluation Criteria:
Correctness of SQL syntax and logic
Implementation of error handling and transactions
Successful execution of stored procedures
Clarity and organization of submitted SQL script
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
