joins query in sql code example
Example 1: how to join tables in sql
JOINING 2 Tables in sql
SELECT X.Column_Name , Y.Column_Name2
FROM TABLES1_NAME X
INNER JOIN TABLES2_NAME Y ON X.Primary_key = Y.Foreign_key;
SELECT E.FIRST_NAME , J.JOB_TITLE
FROM EMPLOYEES E
INNER JOIN JOBS J ON J.JOB_ID = E.JOB_ID;
Example 2: sql server joins
SELECT Orders.OrderID, Customers.CustomerName, Orders.OrderDate
FROM Orders
INNER JOIN Customers ON Orders.CustomerID=Customers.CustomerID;
Example 3: sql join
SELECT Coloumn_Name(s) FROM Table_1, Table_2 WHERE Table_1.Primary_key = Table_2.Foreign_key;