55.7k views
5 votes
SQL'S JOIN Operator (INNER JOIN) inside a FROM clause (ON/ USING)

Option 1: INNER JOIN
Option 2: LEFT OUTER JOIN
Option 3: RIGHT OUTER JOIN
Option 4: FULL OUTER JOIN

1 Answer

2 votes

SQL's JOIN operator includes INNER JOIN, LEFT OUTER JOIN, RIGHT OUTER JOIN, and FULL OUTER JOIN.

In SQL, the JOIN operator is used to combine rows from different tables based on a related column between them. There are four types of JOIN operators:

  1. INNER JOIN: Returns only the matching records from both tables.
  2. LEFT OUTER JOIN: Returns all records from the left table and the matching records from the right table.
  3. RIGHT OUTER JOIN: Returns all records from the right table and the matching records from the left table.
  4. FULL OUTER JOIN: Returns all records when there is a match in either the left or right table.

For example, consider two tables: Students and Courses. An INNER JOIN between the two tables will return the matching records where a student is enrolled in a course.

User Maxime P
by
8.5k points