SELECT cName,score FROM course,sc WHERE sc.cNo = course.cNo AND sNo = (SELECT sNo FROM student WHERE sName = '王兵');
时间: 2024-06-10 09:06:19 浏览: 181
您想查询学生王兵所选的课程名和分数,正确的SQL语句应该是:
SELECT cName, score FROM course, sc
WHERE sc.cNo = course.cNo
AND sc.sNo = (SELECT sNo FROM student WHERE sName = '王兵');
相关问题
USE teaching SELECT A.sno, sname, C.cno, cname, score FROM student A ,sc B , course C where B.cno=C.cno and A.sno=B.sno AND score>=90 该程序的功能是:
该程序的功能是查询学生的成绩信息,包括学生学号、姓名、课程编号、课程名称和分数,但是只查询分数大于等于90分的记录。查询结果来自三个表:student(学生表)、sc(成绩表)和course(课程表)。通过INNER JOIN语句连接这三个表,并使用WHERE子句过滤出分数大于等于90分的记录。最终查询结果会包括学生的姓名、课程的名称以及对应的分数信息。
delete from sc from sc join student on sc.sno=student.sno from sc join course on sc.cno=course.cno where student.sdept ='计算机系'and grade <60 and cnamne='java'对不对
这个 SQL 语句有语法错误,正确的语句应该是:
```sql
DELETE sc FROM sc
JOIN student ON sc.sno = student.sno
JOIN course ON sc.cno = course.cno
WHERE student.sdept = '计算机系' AND sc.grade < 60 AND course.cname = 'java';
```
这条 SQL 语句的作用是删除选修了“java”课程且所在学生所在院系为“计算机系”且该门课程的成绩低于60分的记录。
阅读全文