We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
题目要求将学生表和班级表的所有行组合在一起,并返回学生姓名(student_name)、学生年龄(student_age)、班级编号(class_id)以及班级名称(class_name)。
提供的答案是 select s.name student_name, s.age student_age, s.class_id class_id, c.name class_name from student s, class c;
因为 class 表里同样有 id 字段,表示班级编号,将 s.class_id class_id 改为 c.id class_id 之后满足题目的要求,但查询结果与答案不一致,无法通过关卡。
The text was updated successfully, but these errors were encountered:
可以看第2关的说明,输出结果不一样,就不通过。
注意,所有题目的 数据列输出顺序必须和题目的要求保持一致 !比如本题必须学生姓名(name)在前,年龄(age)在后。
第20关的题目给人感觉需要返回的 class_id 对应的是学生的 class id,而不是 class_name 对应的 class id。因为在学生表中每个学生的 class id 都是唯一的,而班级表中是一对多的关系。
class_id
class_name
这里客观地说写 student.class_id 怪怪的,因为像鸡哥这个学生就进了4个班,学生表里只写了1,class.id 反而更_正确_。
student.class_id
鸡哥
class.id
其实示例也有这问题,反正就三个部门,部门经理和员工肯定在同一个部门,把 e.department 换成 d,department 也没事,甚至输出都是一样的。
e.department
d,department
SELECT e.emp_name, e.salary, e.department, d.manager FROM employees e CROSS JOIN departments d;
SELECT e.emp_name, e.salary, d.department, d.manager FROM employees e CROSS JOIN departments d;
Sorry, something went wrong.
No branches or pull requests
题目要求将学生表和班级表的所有行组合在一起,并返回学生姓名(student_name)、学生年龄(student_age)、班级编号(class_id)以及班级名称(class_name)。
提供的答案是 select s.name student_name, s.age student_age, s.class_id class_id, c.name class_name from student s, class c;
因为 class 表里同样有 id 字段,表示班级编号,将 s.class_id class_id 改为 c.id class_id 之后满足题目的要求,但查询结果与答案不一致,无法通过关卡。
The text was updated successfully, but these errors were encountered: