LXLogicExcel
🔥
0
0
RIGHT JOIN1 / 10
RIGHT JOIN is similar to LEFT JOIN, but reversed. All rows from the second (right of JOIN) table appear in the results, and only rows from the first ("left") table with matches to the second table appear. The non-matching rows will show null. Try:

SELECT e.employee_name, c.company_name FROM companies AS c RIGHT JOIN employees AS e ON c.company_id = e.company_id;

Note which employees in the second table don't have a company_id with a match in the first table.

Also note that we are shortening the query by using table aliases to rename the tables "c" and "e."

Ctrl+Enter to submit

🔥 0 streak
0 XP this lesson
All lessons