How many invoices correspond to each order id?
select order_id, count(*) from invoices group by order_id