例题
ALTER TABLE student ADD s_entrance DATA;
ALTER TABLE student ALTER column sage INT;
ALTER TABLE course ADD UNIQUE(cname);
select sno,sname
FROM student;
3.20
select sname,'year of birth',2014-sage,LOWER(sdept)
FROM student;
select sname 名字,'year of birth:'birth,2014-sage birthday,
LOWER(sdept)department
FROM student;
3.21
select sno
FROM student;
select ALL sno
FROM student;
select DISTINCT sno
FROM student;
3.22
select sname
FROM student
WHERE sdept='cs';
3.23
select sname,sage
FROM student
WHERE sage<20;
3.24
select DISTINCT sno
FROM sc
WHERE grade<60;
3.25
select sname,sdept,sage
FROM student
WHERE sage BETWEEN 20 AND 23;
3.26
select sname,sdept,sage
FROM student
WHERE sage NOT BETWEEN 20 AND 23;
3.27
select sname,ssex
FROM student
WHERE sdept IN('cs', 'ma','is');
3.28
select sname,ssex
FROM student
WHERE sdept NOT IN('cs', 'ma','is');
3.29
select *
FROM student
WHERE sno LIKE '201215121';
select *
FROM student
WHERE sno = '201215121';
3.30
select sname,sno,ssex
FROM student
WHERE sname LIKE '刘%';
3.31
select sname
FROM student
WHERE sname LIKE '欧阳_';
3.32
select sname
FROM student
WHERE sname LIKE '_阳%';
3.33
select sname
FROM student
WHERE sname NOT LIKE '刘%';
3.34
select cno,credit
FROM course
WHERE cname LIKE'DB#_Design' ESCAPE '#';