Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started