▲ | bambax 5 days ago | |
One way to think about 1-to-many relationships is to think in the other way, "many-to-one". You don't join the orders to the customers, you join the customers to the orders (enrich the orders with customer information). It's very natural to want customer information when querying an order, and if you have a view like orders_with_customer_info, you get that with zero effort when querying that view by order id. You also get consolidated data (orders by customer) by doing
which I think is pretty straightforward. |