Answered step by step
Verified Expert Solution
Question
1 Approved Answer
SELECT product_name, list_price ROUND (list_price - list_price* FROM product: 05. 2) AS '50% off! Error Code: 1064. You have an error in your SQL syntax;
SELECT product_name, list_price ROUND (list_price - list_price* FROM product: 05. 2) AS '50% off! Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(list_price- list_price* .05, 2) AS 50% off' FROM product' at line 1 Forgot comma after list price in SELECT list You can't use list_price more than once in a SELECT You can't use an opening parenthesis there The function name is wrong Question 2 SELECT product_name. list_price, ROUNDED (list_price - list_price* .05, 2)AS '50% off! FROM product: Error Code: 1305. FUNCTION bike.ROUNDED does not exist The wrong database is in use The function name should be ROUNDS not ROUNDED The function name should be ROUND not ROUNDED No comma is needed before ROUNDED Question 3 SELECT product_id, ROUND (DATEDIFF(NOW(). shipped_date)/365) AS 'Years since subscription FROM cust_order: Error Code: 1054. Unknown column 'product_id' in 'field list' There shouldn't be a comma after product_id product_id is not a column in the cust_order table O product_id is the table name There should not be a function after product_id SELECT cust_order_id, ROUND (DATEDIFF(NOW(). shipped_date)/365) AS Years since product shipped FROM cust_order: "since" is not valid at th Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'product shipped FROM cust_order' at line 1 since is not spelled correctly You can't have an alias on a long function product shipped' can not follow 'since The alias has spaces so it needs quotes around it Question 5 SELECT cust_order_id, ROUND (DATEDIFF(NOW, shipped_date)/365) AS 'Years since product shipped FROM cust_order: Error Code: 1054. Unknown column 'NOW' in 'field list' NOW is a function and needs parenthesis after it, even if there are no parameters: NOWO You can't capitalize column names NOW is spelled incorrectly DATEDIFF only takes one parameter Question 6 SELECT product_name, list_price, list_price - 500 AS 'Discount Price FROM product WHERE list price > 5000 ORDER BY list_price DSC: "DSC" is not valid at this position, expecting: EOF, ';' Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DSC' at line 4 To list from largest to smallest you use the keyword DESC To list from largest to smallest you use the keyword EOF To list from largest to smallest you use the keyword ASC You don't need to use the keyword DSC because it will default to descendins anyway
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started