Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. The manager of the bookstore wants to know which sales rep sold the most books in 2014 . Use one or PROC SQL to

1. The manager of the bookstore wants to know which sales rep sold the most books in 2014. Use one or PROC SQL to find out. In the final table to present to the manager, include sales rep's name and the number of books sold in 2014. Also make sure the name shows up as first initial, space, and last name.Such As 'J Smith'. There may need to involve more than 2 datasets.

The below table contains the list of all six (6) datasets and their individual variables. Bolded variable names represent common variables with other datasets.

This is the code I've created so far but am struggling to format the name in the requested format. Please advise if code is accurate and how to format name.

proc sql; create table BestSalesRep as select S.name, count(I.quantity) as total_books from _TEMP1.ORDERS as O inner join _TEMP1.ITEMS as I on O.orderno = I.orderno inner join _TEMP1.SALESREP as S on S.salesid = O.salesid where year(O.dateord) = 2014 group by S.salesid order by total_books desc; quit; proc print data=BestSalesRep (obs=1); run;

Customers

Items

List

Orders

Prices

SalesRep

fname

orderno

bookid

salesid

bookid

id

lname

bookid

title

custid

datefirst

name

address1

dateship

author

orderno

price

salesid

city

quantity

author2

dateord

datelast

stcode

yearpub

zip

isbn

custid

phone

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

A Survey Of Mathematics With Applications

Authors: Allen R. Angel, Christine D. Abbott, Dennis Runde

11th Edition

0135740460, 978-0135740460

More Books

Students also viewed these Mathematics questions

Question

Let v = (2, 5) and w = (3, 2). Find the length of v + w.

Answered: 1 week ago

Question

What committees does the person serve on?

Answered: 1 week ago

Question

227. Explain how accountants measure income.

Answered: 1 week ago