Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SQL Query quesiton: Identify the currency of the foreign country with the highest number of orders. I tried select c.CurrencyCode,c.Name from CurrencyRate cr join (select

SQL Query quesiton: Identify the currency of the foreign country with the highest number of orders.

I tried

select c.CurrencyCode,c.Name from CurrencyRate cr join (select CurrencyRateID,count(*) from SalesOrderHeader group by CurrencyRateID having count(*)= (select max(cnt) from(SELECT CurrencyRateID, count(SalesOrderID) as cnt from SalesOrderHeader group by CurrencyRateID)))b on cr.CurrencyRateID=b.CurrencyRateID join Currency c on cr.ToCurrencyCode=c.CurrencyCode;

But it did not work.

schema link: https://i.stack.imgur.com/LMu4W.gif

image text in transcribed

AdventureWorks 2008 OLTP Schema Sales HumanResourccs Person Production Schemas Sales Purchasing Person Production AdventureWorks 2008 OLTP Schema Sales HumanResourccs Person Production Schemas Sales Purchasing Person Production

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

Oracle Database Foundations Technology Fundamentals For IT Success

Authors: Bob Bryla

1st Edition

0782143725, 9780782143720

More Books

Students also viewed these Databases questions

Question

Write a Python program to check an input number is prime or not.

Answered: 1 week ago

Question

Write a program to check an input year is leap or not.

Answered: 1 week ago

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago