can anyone give me an example of inner join? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

can anyone give me an example of inner join?

22nd Aug 2016, 8:05 AM
Dipayan Pramanik
Dipayan Pramanik - avatar
4 Answers
+ 3
SELECT table1.name, table2.score FROM table1 INNER JOIN table2 ON table1.id=table2.id
22nd Aug 2016, 5:45 PM
Tiger
Tiger - avatar
+ 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:
22nd Aug 2016, 7:03 PM
Raton Kumar
Raton Kumar - avatar
+ 2
select name,subject from student,subjects where student.id=subject.id;
25th Aug 2016, 2:09 AM
Amit Singh
Amit Singh - avatar
+ 1
You create a new table joining the output from 2 table.
22nd Aug 2016, 9:21 PM
Diego