This will help yyou get started
[php]SELECT *
FROM
test
.table1
INNER JOIN test
.table3
ON (table1
.id
= table3
.student_id
)
INNER JOIN test
.table2
ON (table3
.subject_id
= table2
.id
)
WHERE table3
.student_id
= 1;[/php]
result of student _id = 1
[code]id name age id student_id subject_id mark id name
1 james 12 1 1 1 6 1 history
1 james 12 3 1 4 8 4 german
[/code]
or if you wanted it by make greater than
[php]SELECT *
FROM
test
.table1
INNER JOIN test
.table3
ON (table1
.id
= table3
.student_id
)
INNER JOIN test
.table2
ON (table3
.subject_id
= table2
.id
)
WHERE table3
.mark
>= 1;[/php]
result greater than or equal to 1
id name age id student_id subject_id mark id name
1 james 12 1 1 1 6 1 history
2 mark 15 2 2 1 7 1 history
1 james 12 3 1 4 8 4 german
3 david 17 4 3 1 9 1 history
3 david 17 5 3 2 10 2 english