0

I am currently learning SQL. I am trying to create Views using Oracle SQL Developer. I came across the JOIN statement but I do not understand why do we need JOIN. According to W3School, the purpose of JOIN is to join multiple rows together. I can do that without the expression JOIN (refer to the following code blocks, both of them produce the same view/table). So what is the purpose of JOIN?

With INNER JOIN:

SELECT 
    Acc.Cust_Id,
    Cus.Address,
    Acc.Avail_Balance
FROM 
    Account Acc
INNER JOIN
    Customer Cus
ON
    Acc.Cust_Id = Cus.CUST_ID

Without INNER JOIN:

SELECT 
    Acc.Cust_Id,
    Cus.Address,
    Acc.Avail_Balance
FROM 
    Account Acc,
    Customer Cus
WHERE
    Acc.Cust_Id = Cus.CUST_ID
karansky
  • 538
  • 1
  • 4
  • 24
  • 1
    JOINS keep your QUERY more easily understandable by other users (**1.** mostly useful if you work in an organization where employees come/leave and work in shifts. **2.** Sometimes when you build bigger scripts/queries it is also helpful in identifying the process-flows. **3.** Joins become useful when you have to build complex queries using LEFT-OUTER JOIN etc) – Asif Mehmood Mar 29 '16 at 07:31
  • thanks! I didn't know they were called implicit or explicit JOIN – karansky Mar 29 '16 at 07:34

1 Answers1

0

The two queries are the same, except the 1st one ANSI-92 SQL syntax and the and other is older SQL syntax which didn't incorporate the join clause. They should produce exactly the same internal query plan, although you may like to check.

check This link ANSI vs. non-ANSI SQL JOIN syntax

Community
  • 1
  • 1
Ramki
  • 453
  • 2
  • 7