A: Discount field doesn't exist in the table.
B: OK
C: OK
D: Discount field doesn't exist in the table.
E: Date * Number is not a valid operation
F: Depending on the values, it may or may not be OK. if the entered values are numeric, this statement will work. Because the question requires 3 answers, I pass this option as correct.
BCF
The three queries that use valid expressions are:
B. SELECT product_id, (unit_price * 0.15 / (4.75 + 552.25)) FROM products;
C. SELECT product_id, (expiry_date - delivery_date) * 2 FROM products;
F. SELECT product_id, unit_price, unit_price + surcharge FROM products;
Explanation:
A. This query is invalid because the alias "S" is not defined anywhere in the query.
B. This query is valid. It calculates a value based on the unit price of each product using a mathematical expression.
C. This query is valid. It calculates the difference between the expiry date and delivery date for each product and multiplies it by 2.
D. This query is invalid because the alias "discount" is not defined anywhere in the query.
E. This query is invalid because you cannot multiply a date value by a number.
F. This query is valid. It selects the product ID, unit price, and the sum of the unit price and surcharge for each product.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
GunduzHuseynli
Highly Voted 2 years, 4 months agoextopic01
2 years, 4 months agozzsqlcoder
3 months, 3 weeks agogioves28
2 years, 3 months agodici79
Most Recent 1 week, 2 days agoDrexan
2 months, 3 weeks agoalelejaja
7 months, 3 weeks agotom2992
8 months, 3 weeks agoLee_jong_suk
1 year, 1 month agoTMerlo
1 year, 3 months agojm9999
1 year, 4 months agofantastic_side_eye
1 year, 6 months agozouve
1 year, 7 months agoNelita
1 year, 8 months agoIndhumathishan
1 year, 8 months agoVoidWanderer
4 months, 3 weeks agoholdfaststrongly
2 years, 3 months agoMZEnuovazelanda
2 years, 4 months agogabolka
2 years, 4 months agoEfstathia
2 years, 4 months agoCyberP
1 year, 7 months agoMySekQL
1 year, 4 months agoAveragenoob
2 years, 4 months ago