数据库!!!着急!!答案对加100分!!!!!!!!!

来源:百度知道 编辑:UC知道 时间:2024/05/22 10:38:31
2.根据上题关系用SQL语言写出下列查询。(6分)
1)所有年龄在20岁以下的女学生的姓名、出生日期及年龄。
2)求所有姓李的老师所开设的课程号及课程名
3.根据上题关系写出下列关系代数表达式(6分)
1)求李红老师承担课程的课程号,课程名。
2)查1998年元旦以后出生的全体男同学。

1:select 姓名,生日,年龄 from 表名 where 年龄<20 and 性别='女'
2:select 课程号,课程名 from 表名 where 姓名 like ‘李%’
3:select 课程号,课程名 from 表名 where 姓名='李红'
4:select * from 表名 from 表名 where 生日<1998-01-01 and 性别='男'

2.(1).select sname,brithday,sage
from student
where sage<='20'
如果生日的字段不是直接给的就写 '现在的日期'-sage
(2).select cno,cname
frrom course
where teacher like'%李'
3.(1)π cno,cname(σteacher='李红'(course))
(2)π sname(σ现在的日期-sage>19881.1(student))

select 姓名,生日,年龄 from 表名 where 年龄<20 and 性别='女'
select 课程号,课程名 from 表名 where 姓名 like ‘李%’
select 课程号,课程名 from 表名 where 姓名='李红'
select * from 表名 where 生日<1998-01-01 and 性别='男'

select name,birthday,age
from biao
where age>=20 and sex='女'

都是最简单的基础知识,上课不好好听,来着找枪手!
快跑

是sql server 还是my sql ?