• Ask a Question
  • Create a Poll
150
    Ask a Question
    Cancel
    150
    More answer You can create 5 answer(s).
      Ask a Poll
      Cancel

      Problem solved using Demo Database at https://www.w3schools.com/sql. I solved the first of the two problems, but I can't solve the second. Help me

      Using the Demo Database, write a SQL* statement to select all the employees that have registered (sales) more than 10 orders. It should be able to list 1) last and first names of the employees, and 2) the total number of orders the employees registered. Print out SQL statement and results. Put the SQL statement and result here.

      1. solved SELECT employees.employeeid, firstname, lastname, count(orders.employeeid) as sales FROM employees LEFT JOIN orders ON Orders.employeeID=employees.employeeID GROUP by orders.employeeid having count(orders.employeeid)>10 ;

      2. need help (I think the answer is 190) SELECT sum(orders.employeeid) FROM employees LEFT JOIN orders ON Orders.employeeID=employees.employeeID GROUP by orders.employeeid having count(orders.employeeid)>10 ;

      0 Answers