Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

product ( product_id INT(4) NOT NULL PRIMARY KEY, category_id INT(4) NOT NULL, p

ID: 3690498 • Letter: P

Question

product ( product_id INT(4) NOT NULL PRIMARY KEY, category_id INT(4) NOT NULL, product_code VARCHAR(10) NOT NULL UNIQUE, product_name VARCHAR(50) NOT NULL, description TEXT NOT NULL, list_price DECIMAL(10 , 2 ) NOT NULL, discount_percent DECIMAL(10 , 2 ) NOT NULL DEFAULT 0.00, date_added DATETIME DEFAULT NULL, vendor_id INT(4), CONSTRAINT products_fk_category FOREIGN KEY (category_id) REFERENCES category (category_id), CONSTRAINT product_fk_vendor FOREIGN KEY (vendor_id) REFERENCES vendor (vendor_id) . Write a SELECT statement that returns these columns from the Products table: The ListPrice column The DiscountPercent column A column named DiscountAmount that uses the previous two columns to calculate the discount amount and uses the ROUND function to round the result to 2 decimal places plz help me

Explanation / Answer


select product_id,category_id,product_code ,product_name,description,list_price ,discount_percent,date_added,vendor_id,products_fk_category ,product_fk_vendor,(100.0 * [TotalVisit1]/[TotalVisits]) AS DiscountAmount from products;