Question

I need to write an SQL statement to run this query: SALES has the following column...

I need to write an SQL statement to run this query:

SALES has the following column names: vendorid, name, upc, move, price, qty, year, store

the table name is SALES... the sales is not a column in the SALES so it needs to be created in the query with the formula as well.

QUESTION BELOW:

Query 4: Return the vendor id, vendor name, product UPC code, move, and sales (price * move/qty) for each product sold by store 100 in 1995. Sort by sales descending. N.B since ‘year’ is a reserved word in SQL, you will need to surround the field year in quotes in order for it to work.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Since you have not provided the db schema, I am providing the queries by guessing the table and column names. Feel free to reach out in case of any concerns.

QUERY

SELECT vendor_id, vendor_name, upcCode, move, (price * move / qty) as sales from SALES where storeId = 100 and `year` = 1995 order by sales desc;

Add a comment
Know the answer?
Add Answer to:
I need to write an SQL statement to run this query: SALES has the following column...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT