Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The sales table below is to be used for the next 10 questions Which SQL statement would return all rows where the state is CA?

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
The sales table below is to be used for the next 10 questions Which SQL statement would return all rows where the state is "CA"? * a) SELECT *FROM sales WHERE state = "CA" b) SELECT * FROM sales WHERE IN state = "CA" c) SELECT * FROM sales IN WHERE state = "CA" d) SELECT *FROM sales IF state = "CA" Which SQL statement would return the sum of total sales for all rows? * a) SELECT SUM(total_sales) FROM sales b) SELECT total_sales FROM sales c) SELECT COUNT(*) FROM sales d) SELECT AVG(price_per_unit) FROM sales Which SQL statement would return the highest price per unit for any product? a) SELECT AVG(price_per_unit) FROM sales b) SELECT MAX(price_per_unit) FROM sales c) SELECT MIN(price_per_unit) FROM sales d) SELECT SUM(price_per_unit) FROM sales Which SQL statement would return the average quantity sold per order? * a) SELECT COUNT(*) FROM sales b) SELECT SUM(quantity) FROM sales c) SELECT AVG(quantity) FROM sales d) SELECT MAX(quantity) FROM sales Which SQL statement would return all rows where the product is either "Tshirt" or "Hoodie"? a) SELECT * FROM sales WHERE product IN ("T-shirt", "Hoodie") b) SELECT * FROM sales WHERE category = "Apparel" c) SELECT * FROM sales WHERE city = "Seattle" d) SELECT * FROM sales WHERE price_per_unit > 100 Which SQL statement would return the distinct cities where sales were made? a) SELECT DISTINCT city FROM sales b) SELECT city FROM sales GROUP BY city c) SELECT UNIQUE city FROM sales d) SELECT COUNT(DISTINCT city) FROM sales Which SQL statement would return the total sales for all rows where the quantity sold was greater than 5 ? a) SELECT SUM(total_sales) FROM sales WHERE quantity > 5 b) SELECT SUM(total_sales) FROM sales WHERE quantity >5 d) SELECT total_sales FROM sales WHERE quantity >=5 Which SQL statement would return the average price per unit for all products in the "Electronics" category? a) SELECT AVG(price_per_unit) FROM sales WHERE category = "Electronics" b) SELECT MAX (price_per_unit) FROM sales IF category = "Electronics" c) SELECT MIN(price_per_unit) FROM sales ORDER category = "Electronics" d) SELECT SUM(price_per_unit) FROM sales WHERE category = "Electronics" Which SQL statement would return all rows where the city is "New York" 2 poin and the category is "Apparel"? a) SELECT *FROM sales IF city = "New York" AND category = "Apparel" b) SELECT * FROM sales WHERE city = "New York" AND category = "Apparel" c) SELECT * FROM sales WHERE city = "New York" OR category = "Apparel" d) SELECT * FROM sales WHERE city IN ("New York", "Los Angeles") AND category = "Apparel" Which SQL statement would return the total sales for each category? * 2 points a) SELECT total_sales FROM sales GROUP category b) SELECT SUM(total_sales) FROM sales GROUP BY category c) SELECT SUM(*) FROM sales GROUP BY category d) SELECT COUNT(*) FROM sales GROUP BY category

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

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

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Accounting questions