数据库系统原理 作业

来源:百度知道 编辑:UC知道 时间:2024/05/11 16:37:32
作业如图,请问高手用文档的形式发给我。
QQ:793665191
或者粘在这个上面。连接是这个题目:
http://blog.163.com/levis503@126/prevPhoto.do?photoId=fks_087065085085081065082087095070072087081071083095081070093087&albumId=-1

我出200分请大家踊跃相佐,谢谢。应该用SQL语言

1
create table emp
(
eno char(10) not null primary key,
ename char(10),
age int,
sex char(10),
ecity char(50)
)
alter table emp add constraint checkage check(age between 0 and 150)
alter table emp add constraint checksex check(sex='男' or sex='女')
create table comp
(
cno char(10) not null primary key,
cname char(50),
city char(50)
)
create table works
(
eno char(10) not null,
cno char(10) not null,
salary int,
primary key(eno,cho)
)
alter table works add constraint enofor foreign key(eno) references emp(eno)
alter table works add constraint cnofor foreign key(cno) references comp(cno)
2
select eno,ename from emp where age>50 and sex='男'
3
select emp.eno,ename from emp join works on emp.eno=works.eno
join comp on comp.cno=works.cno
where salary>1000 and sex = '男'