Picture 7.1
Question 8:
[1 mark] Create a stored procedure named proc_product_model to calculate the count of distinct products belonging to a given model where @modelID int is an input parameter and @numberOfProducts int is an output parameter of the procedure.
For example, when we execute the procedure proc_product_model by using the following statements, the result should be as in the following figure:
declare @x int
exec proc_product_model 9, @x output
select @x as NumberOfProducts
NumberOfProducts
1 12
Question 9:
Picture 8.1
[0.5 mark] Create a trigger named tr_insert_Product_Subcategory for the insert statement on table Product so that when we insert one or more rows into the table Product, the system will
Zoom
+ 63%
Close