I'm new to MySQL and trying to perform a full outer join operation on 3 tables:
Student:-
usn(Primary key)
name
plays :-
usn(foreign key)
sport_id(foreign key)
sport :-
sport_id(primary key)
sport_name
I want to get names of Students who play some sports and if they don't play any, i want NULL (thus the full outer join),
I tried executing the query :
select student.name, sport.name
from student
full outer join plays on student.usn = plays.usn
full outer join sport on plays.sport_id = sport.sport_id;
But, i am getting an error:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL
server version for the right syntax to use near 'outer join plays on student.usn = plays.usn
LIMIT 0, 25' at line 3
Can you please tell me what is it that i am doing wrong...?