SQL JOIN Statement

SQL JOINs which contain the JOIN keyword, are used to query certain data from different tables in a database by using the relationship between the columns of the tables. The relationship between the tables are usually established with keys.

There are different SQL JOINs.

  • SQL JOIN is used to return rows when there is at least one match in both tables
  • SQL LEFT JOIN
  • SQL RIGHT JOIN
  • SQL FULL JOIN


Database Table “Members”

MId FirstName LastName Email City Phone
1 Gilbert Duncan [email protected] Newark 973-600-3300
2 Elvis Daniels [email protected] Piscataway 862-600-3050
3 Michael Green [email protected] Detroit 732-500-5050
4 Kelvin Graham [email protected] Detroit 732-555-5050

Database Table “Orders”

OId OrderNumber MId
1 513847 2
2 967254 1
3 234178 4
4 657234 3