编写SQL查询以查找为某个位置提供的单元注册的学生?

时间:2018-04-04 03:45:19

标签: sql oracle

Problem Table “我认为这样会使用所有三个表格。但我无法在表格Student_1Course之间建立关系。

@ APCT这段代码正在运作。但只给2名学生而不是3名,我的桌子上有没有错误? Course table student_2 table Student_1 Answer from @APC code

4 个答案:

答案 0 :(得分:1)

  

"对于学生ID,没有选择行"

计算机非常精确。它们将完全按照您编写的方式运行代码。您的查询具有此WHERE子句:

location like '%burwood%'

但如果仔细查看course中的数据,您会发现location中的值为Burwood'Burwood'不等于'burwood',因为在主要信件的情况下存在差异。

如果你写了这样的WHERE子句,你会得到结果:

location like '%urwood%'

但是,使用相等过滤器进行过滤总是更好:

 select s1.student_id
        , s1.student_fname
        , s1.student_fname
        , c.course
 from course c
      join student2 s2 on s2.course_id = c.course_id
      join student1 s1 on s1.student_id = s2.student_id
 where c.location = 'Burwood';

答案 1 :(得分:0)

$('.classname').not(this).not(':disabled').prop('checked', this.checked);

答案 2 :(得分:0)

"+"

答案 3 :(得分:-1)

select Student_ID,Student_FName,c.Location from Student1 as s1 Left Join Student2 as s2 on s1.Student_ID = s2.Student_ID Left join Course as c on s2.Course_ID = c.Course_ID where c.Location = "Burwood"; 
  

这个MS SQL QUERY你可以尝试

相关问题