i have a homework question im having some trouble with. I am asked to a total number of products form our database that have never been sold.
it should look like this:
+--------------------------------------------+
| number of products that have not been sold |
+--------------------------------------------+
| 228 |
+--------------------------------------------+
I keep getting this:
+--------------------------------------------+
| number of products that have not been sold |
+--------------------------------------------+
| 0 |
+--------------------------------------------+
my query is:
SELECT count(*) AS 'number of products that have not been sold'
FROM orderdetail
JOIN invoice on invoice.invoiceid=orderdetail.invoiceid
WHERE productid is null;