database - How to display data from multiple tables in SQL -


i'm relatively new sql. i'm trying figure out how satisfy condition: display customer_id, customer_last_name, order_id,order_item_id, product_name customer living in virginia.

so far, have this, i'm not sure how display values together. appreciated.

select customer_id, cust_first_name demo_customers cust_state= 'va'  select order_id demo_orders customer_id= '1' 

you need join

select customer_id, cust_first_name, order_id, order_item_id, product_name demo_customers inner join demo_orders on demo_orders.customer_id = demo_customers.customer_id cust_state= 'va' 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -