# Write a query to display the employee number, last name, first name, and sum of invoice totals for all employees who completed an invoice. Sort the output by employee last name and then by first name (Figure P7.44). FIGURE P7.44 TOTAL VALUE OF INVOICES COMPLETED BY EACH EMPLOYEE

### Database Systems: Design, Implemen...

13th Edition
Carlos Coronel + 1 other
Publisher: Cengage Learning
ISBN: 9781337627900

Chapter
Section

### Database Systems: Design, Implemen...

13th Edition
Carlos Coronel + 1 other
Publisher: Cengage Learning
ISBN: 9781337627900
Chapter 7, Problem 44P
Textbook Problem
54 views

## Write a query to display the employee number, last name, first name, and sum of invoice totals for all employees who completed an invoice. Sort the output by employee last name and then by first name (Figure P7.44).FIGURE P7.44 TOTAL VALUE OF INVOICES COMPLETED BY EACH EMPLOYEE

Program Plan Intro

ORDER BY Clause:

SQL contains “ORDER BY” clause in order to sort rows. The values get sorted in ascending as well as descending order. The keyword used to sort values in ascending order is “ASC” and for descending order is “DESC”. By default, it sorts values by ascending order.

Syntax:

SELECT column_Name1, column_Name2 FROM table_Name ORDER BY column_Name2;

### Explanation of Solution

Query:

Query to sort the employee last name and then by first name from the table is as follows: The below query was executed using the tool “Access 2013”.

SELECT EMP_NUM, EMP_LNAME, EMP_FNAME, Sum(INV_TOTAL) AS TOTALINVOICES

FROM LGINVOICE, LGEMPLOYEE

WHERE EMP_NUM = EMPLOYEE_ID

GROUP BY EMP_NUM, EMP_LNAME, EMP_FNAME

ORDER BY EMP_LNAME, EMP_FNA...

### Still sussing out bartleby?

Check out a sample textbook solution.

See a sample solution

#### The Solution to Your Study Problems

Bartleby provides explanations to thousands of textbook problems written by our experts, many with advanced degrees!

Get Started

#### Additional Engineering Textbook Solutions

Find more solutions based on key concepts
Work is calculated by multiplying by.

Automotive Technology: A Systems Approach (MindTap Course List)

For a building located in Baltimore, Maryland with annual heating degree-days (dd) of 4654, a heating load (hea...

Engineering Fundamentals: An Introduction to Engineering (MindTap Course List)

What is the difference between a context diagram d diagram 0? Which symbol is nor used in a context diagram?

Systems Analysis and Design (Shelly Cashman Series) (MindTap Course List)

If your motherboard supports ECC DDR3 memory, can you substitute non-ECC DDR3 memory?

A+ Guide to Hardware (Standalone Book) (MindTap Course List)

Explain how to evaluate extended warranty options for electronic devices.

Enhanced Discovering Computers 2017 (Shelly Cashman Series) (MindTap Course List)

What are taps on a welding transformer?

Welding: Principles and Applications (MindTap Course List)