Question
  • (#3a){Screenshot.} Create a VIEW named ProductProfit that displays the Category Description, Product Description, and the Profit (SalePrice - Cost). Name the Category description column ‘Category’ and the Product description ‘Item’. The screenshot should show the SQL code to create the view and a SELECT statement displaying the records returned in descending order of the Profit column.
  • (#3b){Screenshot.} Using the ProductProfit VIEW, display the records that are in the TOP 10 Percent of Profit. The screenshot should show the SELECT statement and the records returned.
  • (#4a){Screen shot.} Create a VIEW named FamilyRide that displays the Category description, the Product Description, the Cost and the SalePrice. Name the Category description column ‘Category’ and the Product description ‘Item’. The screenshot should show the SQL code to create the view and a SELECT statement displaying the records returned in ascending order of the Item column.

Category CID Description Product PID Description CID (fk) Cost SalePrice AvailableOnline (Y, N)

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

If you have any doubts, please give me comment...

-- #3a

CREATE VIEW ProductProfit AS

SELECT C.Description AS Category, P.Description AS Item, (SalePrice - Cost) AS Profit

FROM Category C, Product P

WHERE C.CID = P.CID;


-- #3b

SELECT *

FROM ProductProfit

ORDER BY Profit DESC

LIMIT 10;

-- #4a

CREATE VIEW FamilyRide AS

SELECT C.Description AS Category, P.Description AS Item, Cost, SalePrice

FROM Category C, Product P

WHERE C.CID = P.CID;

SELECT *

FROM FamilyRide

ORDER BY Item ASC;

Add a comment
Know the answer?
Add Answer to:
(#3a){Screenshot.} Create a VIEW named ProductProfit that displays the Category Description, Product Description, and the Profit (SalePrice - Cost). Name the Category description column ‘Category’ an...
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