Examness

Advanced SQL

3 exercises · in teaching order

  1. 1Revenue per product categoryRevenue for an order line is `quantity × price`. Return each product **category** and its total revenue across all orders, as columns `category` and `revenue`.multi-joinSUMexpressions14m
  2. 2Paid above the company averageReturn the **name** and **salary** of every employee earning more than the company-wide average salary.scalar subqueryWHERE12m
  3. 3Employees who sold nothingSome employees have handled no orders at all. Return their **name**s - one column, `name`.LEFT JOINIS NULLanti-join14m