Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please write queries based on the following requirements using WideWorldImporter

ID: 3725424 • Letter: P

Question

Please write queries based on the following requirements using WideWorldImporters Database
which is already installed on the SQL Server you used at class.

2. List the date of the first invoice sold by each employee (represented by
SalespersonPersonID). Show your results in ascending order on person full name
(Sales.Invoices and Application.People).

FullName 1Amy Tref First Date 2013-01-01 2 Anthony Grosse 2013-01-01 Lamble2013-01-01 Hudson Hollinworth 2013-01-01 5 Hudson Onslow 2013-01-01 2013-01-01 7 Kayla Woodcock2013-01-01 2013-01-01 2013-01-01 10 Taj Shand 2013-01-01 3 Archer 6 Jack Potter 8 Lily Code 9 Sophia Hinton

Explanation / Answer

select min(firstdate),fullname,id from wideworldimporters group by id.

Here we have given an aggregate function since we need to gather information of all employees who sold the product at the beginning.

Since we need it and we have to group them by their id which is unique and then we hav retrieved the minimum data from what they have sold which gives the result as the first data of their sale