I have two tables: 'purchases' and 'orders'.
The purchases table has purchase_id as primary key and stores the customer_id and purchase details like total.
The 'orders' table stores all the item details related to each purchase, so it has purchase_id, stock_id, quantity, etc..
I want to implement a query which selects the purchase details from the 'purchases' table and item details from the 'orders' table. Both tables share the 'customer_id' column. I have been searching on the internet and have found that the query i'm looking for is called JOIN. However, I do not know which JOIN query to use (ie: INNER JOIN, LEFT JOIN etc..) and I'm struggling to understand how it works even through I've looked at examples on w3schools. Could someone help?