mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-08-11 03:34:00 +02:00
Merge pull request #5114 from MaharshiChoksi/patch-1
Add Natural Join as an example of the types of join
This commit is contained in:
@@ -55,4 +55,15 @@ WHERE A.CustomerID <> B.CustomerID
|
|||||||
AND A.City = B.City;
|
AND A.City = B.City;
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## NATURAL JOIN:
|
||||||
|
|
||||||
|
The natural join is akin to an inner join, automatically linking two columns based on identical names.
|
||||||
|
Note: Columns should have same data type in both tables
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT *
|
||||||
|
FROM Customers
|
||||||
|
NATURAL JOIN Orders;
|
||||||
|
```
|
||||||
|
|
||||||
**Note**: JOINS can be used with SELECT, UPDATE, and DELETE statements.
|
**Note**: JOINS can be used with SELECT, UPDATE, and DELETE statements.
|
||||||
|
Reference in New Issue
Block a user