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;
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;
发布评论
评论(3)
也许使用以下查询
maybe use a query like below
实际上分数和等级之间存在关系..所以加入是合适的
Actually there is a relationship between marks and grade..so a join would be appropriate
有一种关系,但不是平等的。
您也可以在min_mark和max_mark 之间使用
,但是您需要检查MySQL版本是否支持它。
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.