-----例1
SELECT Sno,Sname
from Student;
关系代数:
-----例2
SELECT Sname,Sno,Sdept
from Student;
关系代数:
----例3
SELECT *
FROM Student;
关系代数:
----例4
select Sname ,2004-sage
from Student;
关系代数:
----例5
SELECT Sname,'Year of Birth:',2004-Sage,LOWER(Sdept)
FROM Student;
关系代数:
----例6
SELECT Sno
from SC;
关系代数:
----例7
SELECT Sname
from Student
WHERE Sdept='CS';
关系代数:
----例8
SELECT Sname,Sage
FROM Student
WHERE Sage<20;
关系代数:
----例9
SELECT DISTINCT Sno
from SC
WHERE Grade<60;
关系代数:
----例10
SELECT Sname,Sdept,Sage
From Student
WHERE Sage NOT BETWEEN 20 AND 23;
关系代数:
----例11
SELECT Sname,Sdept,Sage
From Student
WHERE Sage BETWEEN 20 AND 23;
关系代数:
----例12
SELECT Sname,Ssex
from Student
WHERE Sdept IN ('CS','MA','IS');
关系代数:
----例13
SELECT Sname ,Ssex
FROM Student
WHERE Sdept NOT IN('CS','MA','IS');
关系代数:
----例14
SELECT *
FROM Student
WHERE Sno LIKE '200215121';
200215121 李勇男 20 CS 8
关系代数:
----例15
select Sname,Sno,Ssex
from Student
WHERE Sname LIKE '刘%';
刘晨 200215122 女
关系代数:
----例16
select Sname
from Student
WHERE Sname LIKE '李_';
李勇
关系代数:
----例17
SELECT Sname,Sno
from Student
WHERE Sname LIKE '_敏%';
王敏 200215123
关系代数:
----例18
SELECT Sname,Sno,Ssex
from Student
WHERE Sname NOT LIKE'刘%';
李勇 200215121 男
王敏 200215123 女
张立 200215125 男
关系代数:
----例19
redit
from Course
ame LIKE 'DB\_Design'ESCAPE'\';
验证通过
关系
数据库作业---例题 来自淘豆网m.daumloan.com转载请标明出处.