求解一道数据库的题,用关系代数表达式

2021-01-16 05:02:14 字数 5444 阅读 6508

1楼:羊驷

(1) select t.tname,t.titlefrom t inner join c on t.t=c.twhere c.**ame="高等数学"

(2) select dlookup("**ame","c","c='" & sc.c & "'") as **ame

from s left join sc on s.s = sc.swhere s.sname="zhang" and sc.s is null

(3) select c.**ame, c.cfrom c inner join sc on c.

c = sc.cwhere sc.s="s2" or sc.

s="s9"

(4) select s, sname

from s

where age>20 and ***="男"

急!请大侠们指点,一道数据库的题。写出关系代数表达式~~非常感谢! 50

2楼:匿名用户

关系代数的符号不好表达呀

两者理解起来都一样的……

很简单的

3楼:杨力闻

1.use database_name

select s.sno,c.credit from course c join elective e

on c.con=e.con join student s

on s.sno=e.sno

where c.con='c06'

2..use database_name

select s.sname,c.sname from course c join elective e

on c.con=e.con join student s

on s.sno=e.sno

where c.con='c06'

3.select s.sname,c.sname from course c join elective e

on c.con=e.con join student s

on s.sno=e.sno

where c.**ame='english'

4..select s.sno from course c join elective e

on c.con=e.con join student s

on s.sno=e.sno

where c.**o in('c02','c06')

5...select s.sno from course c left join elective e

on c.con=e.con join student s

on s.sno=e.sno

where c.**o in('c02','c06')

6...select s.sno from course c left join elective e

on c.con=e.con join student s

on s.sno=e.sno

where c.**o not in('c02','c06')

7.select sname from student

8.select s.sno from course c left join elective e

on c.con=e.con join student s

on s.sno=e.sno

where s.sno like['s08'%]

呵呵,就这些了

求助 这道数据库 关系代数表达式的题目 的答案

4楼:巍科软件

--1.检索“吴迪”老师讲授的课程号和课程名

select **o ,**ame ,teacher from c where teacher ='吴迪'

--2.检索所有女同学和年龄小于20岁的男同学

select * from s where

s.***='男' and age <20 or s .*** ='女'

--3.检索至少选修“吴迪”老师讲授课程中一门课的学生姓名

select sname from s where sno in (select sno from sc where **o in (select **o from c where teacher ='吴迪' ))

--4.检索“李波”同学不学的课程的课程名

select **ame from c where **o in (select **o from sc where sno not in (select sno from s where sname ='李波'))

--5.检索至少选修两门课程的学生的姓名

select sname from s where sno in (select sno from (select count (sno) as 's**umber',sno from sc group by sno) scs where s**umber >=2)

--6.检索未被选修的课程的课程名

select **ame from c where **o not in (select **o from sc)

--7.检索选修全部课程的学生的学号

select sno from s where sno in (select sno from (select count (sno) as 's**umber',sno from sc group by sno) scs where s**umber = (select count (distinct c .**ame) from c ))

--8.检索选修了“吴迪”老师讲授课程的学生的学号

select sno from s where sno in (select sno from sc where **o in (select **o from c where teacher ='吴迪'))

--9.检索选修了“吴迪”老师讲授课程且成绩高于85的学生的学号sele

select sno from s where dept >85 and sno in (select sno from sc where **o in (select **o from c where teacher ='吴迪'))

--10.检索“王虎”同学所学课程的课程号

select **o from sc where sno = (select sno from s where sname ='王虎')

--11.检索选修了c01和c02两门课程的学生的姓名

select sname from s where sno in ( select sc.sno from sc where sc.sno in(select sc.

sno from sc where sc.**o = (select c.**o from c where c.

**ame ='c01'))and sc.**o=(select c.**o from c where c.

**ame ='c02'))

--12.检索未选修课程的学生的学号

select sno from s where sno not in (select sno from sc ) select * from sc

一道数据库题目,谁能帮我解答下,急!!!

5楼:匿名用户

π是投影,该运算从表中选出指定的属性组成一个新表,记为:πa(r).其中a是属性名(即列名)表,r是表名

σ是选择,该运算按给定的条件,从表中选出满足条件的行形成一个新表,作为一个新表.如:σf(r).其中f为条件表达式,r为表名

1. π姓名,家庭地址σ 职务='科长'(职工)

2. π姓名,家庭地址σ 部门.部门名称='办公室'∧职工.职务='科长'(部门.部门编号∞职工.所属部门编号)

3. π姓名,家庭地址σ部门名称='财务科'∧职务= '科长'(部门.部门编号∞职工.所属部门编号)

4. del from 职工 where 职工号='3016'

5. update 保健 set 健康状况='一般' where 职工号='3016'

6. create view 视图名 as selcet * from 保健 where 健康状况='差'

数据库相关问题,用关系代数表达式表示

6楼:匿名用户

sql语句如下:

1.select * from student where sname='李政'

2.这题见鬼了,没有年龄字段,更没有出生日期等信息,写什么?

3.select sname,sno from student where exists(select 1 from class where clsname='计算机01' and clsno=student.clsno)

4.select clsname from class where exists(select 1 from student where sname='张山' and clsno=class.clsno)

求帮忙做一道数据库题。对高手来说很简单的,帮帮忙,谢谢。

7楼:匿名用户

是要用关系代数表达式吗?全部直接sql语句写完不行吗?

8楼:

1.πcid,**ame(σe68a84e8a2ad62616964757a686964616f31333330343161 teacher='liu'(c))

select cid,**ame from c where teacher = 'liu'

2.πsid,sname(σ age>23∧***='男'(s))

select sid,sname from s where age>23 and ***='男'

3.π**ame,teachre(σ sid = 's3' (c×sc))

select c.cid, **ame,teachre from sc s, c c

where sid = 's3' and s.cid = c.cid

4.πsname(σ *** = '女' ∧teacher='liu' (s×c×sc))

select sname from s s

where exists(select 1 from sc sc,c c where c.teacher='liu' and sc.cid = c.

cid and s.sid=sc.sid) and s.

*** ='女'

5.πcid(sc)-πcid(σ sname='wang'(s×sc))

6.π1(σ1=4∧2≠5(sc×sc))

7.πcid,**ame(c×(πsid,cid(sc)÷πsid(s)))

8.πsid,cid(sc)÷ πcid(σ teacher = 'liu'(sc×c))

关系数据库中,关系代表A、数据表B、查询

1楼 匿名用户 习题答案及解析 第6章6 1 1 1 单项选择题 1 c 2 b 3 a 4 d 5 a 6 d 7 a 8 d 9 a 2 多项选择题 1 abcd 2 abcde 3 填空题 关系数据库sql语言? 2楼 匿名用户 先d d 然后group by a b 然后having avg...

一道数据库的题:设有如下三张关系表

1楼 匿名用户 select 姓名 from 学生表 课程表 成绩表 where 课程表 课名 数据库原理 and 课程表 课号 成绩表 课号 and 学生表 学好 成绩表 学好 你学号写成学好了 分拿来。 2楼 匿名用户 select 姓名 from 学生表 left join 成绩表 on 学生...

关系代数数据库中两个条件查询语言怎么表达

1楼 匿名用户 例 设教学数据库中有3个关系 学生关系s sno sname age 学习关系sc sno o grade 课程关系c o ame teacher 下面用关系代数表达式表达每个查询语句。 1 检索学习课程号为c2的学生学号与成绩。 sno,grade o c2 sc 2 检索学习课程...