Using SQL SERVER 2016
Create a trigger named Products_UPDATE that checks the new valuefor the
DiscountPercent column of the Products table. This trigger shouldraise an
appropriate error if the discount percent is greater than 100 orless than 0.
If the new discount percent is between 0 and 1, this trigger shouldmodify the
new discount percent by multiplying it by 100. That way, a discountpercent
of .2 becomes 20.
Test this trigger with an appropriate UPDATE statement.
DATABASE TABLE SCRIPT
/********************************************************
* This script creates the database named my_guitar_shop
*********************************************************/
USE master;
GO
IF DB_ID(‘MyGuitarShop’) IS NOT NULL
DROP DATABASE MyGuitarShop;
GO
CREATE DATABASE MyGuitarShop;
GO
USE MyGuitarShop;
— create the tables for the database
CREATE TABLE Categories (
CategoryID INT PRIMARY KEY