Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using AdventureWorks2017 For the following question, I have completed steps one and two. However, I have been unable to create a trigger without errors for

Using AdventureWorks2017

For the following question, I have completed steps one and two.  However, I have been unable to create a trigger without errors for the Assignment listed above.  

 

Part 1:
Automating business procedures and automatically maintaining data integrity and consistency are critical in modern business environment. One of the most critical business procedures is proper inventory management. For example, you want to make sure that your current inventory has enough product availability that can support your product sales. Another example is to ensure that your product order is written to the supplier whenever the products inventory count drops below a certain number.
Run the attached script "Products.txt" in your AdventureWorks database then create a Trigger that address the following business logic:
Automatically evaluate the Products Quality On Hand value. If the value of the Products Quality On Hand is below the minimum quantity of that product, then update the Product Reorder value to 1 which means Yes to order more from the supplier.

Submit a Word document (with screenshots) that captures the following:
1. The successful creation of the Products table

(HERE IS THE PRODUCTS.TXT)

Topic 6 Picture 1.PNG

2. Data from the Products table. Hint: Run a SELECT statement

Topic 6 Picture 2.PNG


3. The successful creation and testing of the trigger
 
 

A Web Virtual Machine - Google Chrome lopescloud.gcu.edu/labAgent/vm Display?id=246f8c8d-f656-41f9-be71-fd95a831c9f1&loginPrompt=false LK SQLQuery2.sql - EC2AMAZ-MLE19MR.AdventureWorks 2017 (EC2AMAZ-MLE19MR dp_user (63))* - Microsoft SQL Server Management Studio File Edit View Project Tools Window Help -9 -- New QueryAMMA X da # AdventureWorks 2017 Object Explorer Connect Ready Y C+ Database Snapshots AdventureWorks2017) Database Diagrams Tables: System Tables File Tables dbo.DatabaseLog Edbo.Dates Edbo.ErrorLog External Tables Graph Tables. dbo.AWBuildVersion) Edbo.Products B Columns 100 + Keys - Execute Product Code (varchar(10), null) Product Desc (varchar(100), null) Product QOH (int, null) Product MIN (int, null) Procuct ListPrice (float, null) Product MinOrder (int, null) Product ReOrder (bit, null) Constraints Triggers Indexes Statistics Human Resources.Department Human Resources.Employee Human Resources. Employee Department History Human Resources. EmployeePayHistory Human Resources.JobCandidate Human Resources.Shift Person.Address Person.Address Type Person.Business Entity Person.Business EntityAddress Person.Business EntityContact B x SQL Query2.sql - EC...19MR dp_user (63))*X SQLQuery1.sql - EC...19MR dp_user (68))* Create table Products ( 100% Product Code varchar(10), Product Desc varchar(100), Product QOH INT, Product Quantity On Hand Product MIN INT, -- Minimum Quantity of the product Procuct ListPrice FLOAT, Product MinOrder INT, - this is the minimum quantity for restockin an order Product ReOrder BIT- this indicates whether the product needs to be re-ordered from the vendor (1 = Yes, 0 = No) INSERT INTO Products Values (1, 'Power Supplies', 8, 5, 35.00, 25, 0), (2, 'Hard Disks', 7, 5, 120.00, 50, 0) Select from Products Messages Msg 2714, Level 16, State 6, Line 1 There is already an object named 'Products in the database. Completion time: 2022-11-30T15:05:09. 7324390+00:00 100% ( ! Query completed with errors. I Quick Launch (Ctrl+Q) P x T EC2AMAZ-MLE19MR (15.0 RTM) EC2AMAZ-MLEI9MR dp_us... AdventureWorks2017 00:00:00 0 rows 3:44 PM 11/30/2022

Step by Step Solution

There are 3 Steps involved in it

Step: 1

This query will provide informatio... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Databases questions