I am newbie in SQL development. I am not good in SQL join 🙁 .
please help me to write a SQL query to extract the following fileds from the below tables for the product “A Home Portable Laser Hair Remover“.
Fileds required:
orders.id, orders.order_price, orders.purchase_date, customers.email, product_orders.qty, products.name
Table 1: orders
id customer_id order_price purchase_date
1 1 0.20 12/6/2011
2 2 0.20 12/6/2011
3 1 0.20 12/6/2011
4 1 0.20 12/6/2011
5 1 0.20 12/7/2011
6 3 199.00 12/7/2011
7 4 199.00 12/7/2011
8 5 199.00 12/7/2011
9 6 199.00 12/7/2011
10 7 199.00 12/7/2011
Table 2 : customers
id email name
1 aa@dealboard.com.au aa
2 bb@dealboard.com.au bb
3 cc@live.com.au cc
4 dd@acgglobal.com dd
5 ee.heinrich@det.nsw.edu.au ee
6 ff@optusnet.com.au ff
7 ssy@hotmail.com ss
table 3: products
id name
1 A Home Portable Laser Hair Remover
2 Ipad
3 android
4 Asus
5 s
6 10 inch Android
7 A Fabric Steamer Cleaner
8 A Magnetic Fly Screen Door
9 pillopw
10 LCD
table 4: product_orders
id orders_id product_id qty
1 1 1 1
2 2 1 1
3 3 1 1
4 4 1 1
5 5 2 1
6 6 1 1
7 7 1 1
8 8 1 1
9 9 1 1
10 10 1 1
i wanna extract the all the order for the product id 1 or filter orders by product
please help me
sounds like you want to join across all tables: