实验八SQL语句: create view 计算机系学生(计算机系学生学号,计算机系学生姓名,生日) as select sno,sname,ssex from students where sdept='计算机' with check option; update 计算机系学生 set 计算机姓名='lijiaqi' where 计算机学号='0602001'; insert into 计算机系学生 values ('0702005','王小鸭','f'); drop view 计算机系学生
1、查询“001”课程比“002”课程成绩高的所有学生的学号; select a.S# from (select s#,score from SC where C#='001') a,(select s#,score from SC where C#='002') b where a.score>b.score and a.s#=b.s#; 2、查询平均成绩大于60分的同学的学号和平均成绩; select S#,avg(score) from sc group by S# having
1、查询“001”课程比“002”课程成绩高的所有学生的学号; select a.S# from (select s#,score from SC where C#='001') a,(select s#,score from SC where C#='002') b where a.score>b.score and a.s#=b.s#; 2、查询平均成绩大于60分的同学的学号和平均成绩; select S#,avg(score) from sc group b y S# having
Student(S#,Sname,Sage,Ssex) 学生表 Course(C#,Cname,T#) 课程表 SC(S#,C#,score) 成绩表 Teacher(T#,Tname) 教师表 问题: 1、查询“001”课程比“002”课程成绩高的所有学生的学号; select a.S# from (select s#,score from SC where C#='001') a,(select s#,score from SC where C#='002') b where a.scor
1.查询系号为d01系的女同学名单,输出学号、姓名及出生年月。SELECT sno,sname,birthday from student where dno=’d01’ and sex=’女’; 2.查询姓张的学生信息,输出所有的列。SELECT * from student where sname LIKE '张%'; 3.查询本学期选修了课号为20740063课程的学生名单,输出他们的学号。 SELECT sno from sc where cno='20740063'; 4.查询
1.掌握相关。 2.体会各种查询的异同及相互之间的转换,体会各种查询的执行过程,为综合应用打下良好的基础。 ● 查询没有选修指定课程号的学生的学号、姓名、性别、出生日期和级别。课程号由局部变量提供。 declare @Cno char(6); set @Cno='a00002'; select sno as 学号,sname as 姓名,sex as 性别,birthday as 生日,enter_year as 级别 from Student where sno not in(select
using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; namespace AddressList { /// /// Form1 的摘要说明。 /// public class AddressList : System.Windows.Forms.Form { priva
数据库1、查询"01"课程比"02"课程成绩高的学生的信息及课程分数 (ˇˍˇ) 想~ select distinct s.S# 学号,s.Sname 学生姓名,s.Ssex 性别 ,convert(date,s.Sage) 出生日期,sc.score 分数 from Student s,SC sc,SC ss where s.S#=sc.S# and sc.S#='01' and ss.S#='02' and sc.score>ss.score --1.1、查询同时存在"01"课程和"
摘要: -- 1、查询“01”课程比“02”课程成绩高的所有学生的学号; SELECT a.sid FROM (SELECT sid, score FROM sc WHERE cid=01) a, (SELECT sid ,score FROM sc WHERE cid=02) b WHERE a.score > b.score AND a.sid= b.sid; SELECT a.sid FROM student a LEFT JOIN SC b ON b.cid=01 AND a.s