'How I join two tables with mysql? [closed]
Solution 1:[1]
maybe use a query like below
select s.*,g.grade from students s
left join grades g on s.marks between min_mark and max_mark
Solution 2:[2]
Actually there is a relationship between marks and grade..so a join would be appropriate
Select id,name,marks,grade
from student
join grades on marks between min_mark and max_mark
Solution 3:[3]
There is a relationship, but it is not equals.
You could also use BETWEEN min_mark AND max_mark but you will need to check that your version of MySQL supports it.
SELECT
s.ID,
s.Name,
s.Marks,
g.grade
FROM
Students s,
Marks s
WHERE
s.Marks >= g.Min_Mark
AND
s.Marks <= g.max_Mark;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | DhruvJoshi |
| Solution 2 | P.Salmon |
| Solution 3 |


