Joins are used to query the date from more than 2 tables based on the
relation between them.
Can we store the data in one Table?
Yes we can, but its not a good database design.
Types of Joins
Inner Join
Left Join Left Outer Join
Right Join Right Outer Join
Full Join
Select all records from Table A and Table B, where the join condition is met.
SELECT
sales.sales_date,sales.order_id,sales.product_id,product.product_name
FROM sales INNER JOIN product
On Sales.product_id=product.product_id
Select all records from Table A, along with records from Table B for which the
join condition is met (if at all).
Select all records from Table B, along with records from Table A for which the
join condition is met (if at all).
Select all records from Table A and Table B, regardless of whether the join
condition is met or not.