首页 > 代码库 > 数据库作业,......修删改查

数据库作业,......修删改查

select sname, ssex,sclass from student;

  

 

--查询教师所有的单位即不重复的Depart列。select  distinct  depart from teacher;

  

-- 查询Student表的所有记录。select * from student;

  

--查询Score表中成绩在60到80之间的所有记录。select *from score s where s. degree>=60 and s.degree<=80;

  

--查询成绩是85  86 88 的select * from score s where s.degree=85 or s.degree=86 or s.degree=88;

  

--查询Student表中“95031”班或性别为“女”的同学记录。select *from student s where s.sclass=‘95031‘or s.ssex=‘女‘;

  

--以Class降序查询Student表的所有记录select * from student  order by sclass desc;

  

-- 以Cno升序、Degree降序查询Score表的所有记录。select * from score s order by s. cno , s.degree desc;

  

--建表,并添加数据select * from score s order by s. cno , s.degree desc;create table grade(low  number(3),upp  number (3),rank  char(1));insert into grade values(90,100,‘A‘);insert into grade values(80,89,‘B‘);insert into grade values(70,79,‘C‘);insert into grade values(60,69,‘D‘);insert into grade values(0,59,‘E‘);

  

 

数据库作业,......修删改查