The warehouse exercise 9

Back to The warehouse

Select the codes of all warehouses that are saturated (a warehouse is saturated if the number of boxes in it is larger than the warehouse's capacity).

Without zero count

| SELECT code, warehouse FROM boxes
| GROUP warehouse, code COUNT BY warehouse
| SELECT code, capacity FROM warehouses
| RENAME code warehouse
| JOIN warehouse
| WHERE code-count $> capacity
| PROJECT warehouse
1 row 0 msec
warehouse
1