Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

14.A. Find the item titles and the corresponding order ids. HERE ITEMS , ORDER_DETAILS TABLE CONTAIN SELECT TITLE, ORDER_ID FROM ITEMS I FULL JOIN ORDER_DETAILS

14.A. Find the item titles and the corresponding order ids.

HERE ITEMS , ORDER_DETAILS TABLE CONTAIN

SELECT TITLE, ORDER_ID FROM ITEMS I FULL JOIN ORDER_DETAILS D ON I.ITEM_ID = D.ITEM_ID

B. Now count the number of orders ach item has been included in.

BUT HOW DO I COUNT (ORDER_id)

I TRY

SELECT TITLE, ORDER_ID, COUNT(ORDER_ID) FROM ITEMS I FULL JOIN ORDER_DETAILS D ON I.ITEM_ID = D.ITEM_ID

GROUP BY ORDER_ID;

BUT RESULT IS NOT COME OUT

C. Now report only those items that have been included in more than 5 different orders

SELECT TITLE, ORDER_ID FROM ITEMS I FULL JOIN ORDER_DETAILS D ON I.ITEM_ID = D.ITEM_ID WHERE D.ORDER_DETAILS >5; SAME NO RESULT

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

More Books

Students also viewed these Databases questions

Question

Should role-plays be a mandatory part of training?

Answered: 1 week ago