+ 1
can anyone give me an example of inner join?
4 Answers
+ 3
SELECT table1.name, table2.score FROM
table1 INNER JOIN table2 ON table1.id=table2.id
+ 3
you have a table of football player
id-name-country
1-ab-india
2-wa-england
3-sd-nepal
you have another table of cricket player
id-name-country
1-fg-bhutan
2-wq-thiland
3-gh-india
now your task is to get all football and cricket player info whose country is same
so you need inner join
select football.name, cricket.name
from football inner join cricket on football.country = cricket.country
ans:
+ 2
select name,subject
from student,subjects
where student.id=subject.id;
+ 1
You create a new table joining the output from 2 table.