Question

Oracle 12c Chapter 13 Advanced Challenge To perform the following activity, refer to the tables in...

Oracle 12c Chapter 13 Advanced Challenge

To perform the following activity, refer to the tables in the JustLee Books database about to begin an aggressive ma The Marketing Department of JustLee Books i campaign to generate sales to repeat customers. The strategy is to look at existing customers' past purchases,  which these customers have made purchases, JustLee Books will send promotional information about other books in the category that are highly profitable books for the company. The Marketing Department has requested that you identify the five most frequently purchased books and the percentage of profit each book generates. The percentage of profit can be calculated by using the formula ((retail-cost)/cost 100). The employees in the Marketing Department will use the potential profitability of the marketing campaign to determing how much money to budget for the campaign. Provide an SQL statement along with the output to respond to the Marketing Departments request

This is what I got but I'm getting this error ORA-00933: SQL command not properly ended

select b.Title as book_name,(100.0 * (b.retail-b.cost)) /( select b.cos from Books b ) as percent_profit from Books b inner join ORDERITEMS oi on b.isbn=oi.orderitems_isbn_fk order by oi.Quantity desc limit 5;

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

Solution:

There is a minor issue with your query :

select b.Title as book_name,(100.0 * (b.retail-b.cost)) /( select b.cos from Books b ) as percent_profit from Books b inner join ORDERITEMS oi on b.isbn=oi.orderitems_isbn_fk order by oi.Quantity desc limit 5;

This should be cost. So the correct query would be :

select b.Title as book_name,(100.0 * (b.retail-b.cost)) /( select b.cost from Books b ) as percent_profit from Books b inner join ORDERITEMS oi on b.isbn=oi.orderitems_isbn_fk order by oi.Quantity desc limit 5;

Add a comment
Know the answer?
Add Answer to:
Oracle 12c Chapter 13 Advanced Challenge To perform the following activity, refer to the tables in...
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