To implement joins(inner join,outer,full) in three tables you need to execute following MySQL statements:
select * from
table1 as t1
join table2 as t2 on condition
join table3 as t3 on condition
Example:
Suppose we have a database product having tables product_category(id, category_name), product_info(id,cat_id,name), product_quantity(prod_id, quantity), . We need to display the product details with category name and quantity. To implement this you need to execute the following MySQL statement:
Select prod.id, prod.name, cat.category_name, quan.quantity
from product_category as cat
join product_info as prod on cat.id=prod.cat_id
join product_quantity as quan on quan.prod_id=prod.id
0 Comment(s)