Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Microsoft SQL Server Management Studio: Show just the customer contact name of the customer with the most orders ( Fig. 2 ). Do not use

Microsoft SQL Server Management Studio:

Show just the customer contact name of the customer with the most orders (Fig. 2). Do not use any hard-coded values or row numbers.

I wrote the SQL Script below and it pulled 89 rows (Fig 1). I need an SQL Code to pull the customer contact name of the customer with the most orders (Fig. 2).

SQL Script:

SELECT T.contactname, (T.OrderCount) AS 'Number Of Orders'

FROM(SELECT contactname, COUNT(O.orderid) AS OrderCount

FROM Sales.Orders O

INNER JOIN Sales.Customers C

ON o.custid = c.custid

GROUP BY contactname) AS T

image text in transcribed

Fig. 1 contactname Number Of Orders 9 Mallit, Ken 50 Marinova, Nadejda 51 McLin, Nkenge 52 Meston, Tosh 53 Misiec. Anna 54 Moore, Michael 55 Myrcha, Jacek 56 Nagel, Jean-Philippe 57 Navarro, Toms 58 O Brien, Dave 59 Osorio, Cristian 60 Peoples, John 61 Poland, Carole 10 10 13 18 10 6 31 Fig. 2 contactname Number of Orders Navarro, Toms31

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

Visual C# And Databases

Authors: Philip Conrod, Lou Tylee

16th Edition

1951077083, 978-1951077082

Students also viewed these Databases questions

Question

Assess three steps in the selection process.

Answered: 1 week ago

Question

Identify the steps in job analysis.

Answered: 1 week ago