I have two tables in MySQL as below:
Table1 as below:
ID (Primary Key Auto Increment) | Student Name | Age
Table2 as below:
Teacher Name | Student ID (This is the Student ID from table1) | Email | Education
Now I want to get data from both the tables table1 and table2 in a single query.
I want to retrieve the values from both tables where Student ID is equals to something.
Student Name | Age | Teacher Name
Can you please let me know how can I query values from two tables as mentioned above. I have read many tutorials but I can not retrieve it properly. I am new to MySQL so please explain clearly. What should I use table join, union, inner or outer join?