Avoiding Ambiguity
When both tables have same column name:
sql
1SELECT
2 s.id AS student_id,
3 s.name,
4 c.id AS course_id,
5 c.course_name
6FROM students s
7INNER JOIN courses c ON s.course_id = c.id;
When both tables have same column name:
1SELECT
2 s.id AS student_id,
3 s.name,
4 c.id AS course_id,
5 c.course_name
6FROM students s
7INNER JOIN courses c ON s.course_id = c.id;