Current location - Training Enrollment Network - Books and materials - Query the number of books sold by each employee with SQL.
Query the number of books sold by each employee with SQL.
Select the employee basic information table. Name, sum (sales quantity) is the total sales quantity of employee basic information table and book retail table. Employee number = book retail table. Number of employees grouped by name.

Select the book title, author, sum (sales quantity) as the sales quantity from the book retail table and the book basic information table, and sum (sales quantity) * unit price as the total amount. Book number = basic information table of books. Book numbers grouped by title, author and unit price.