山东大学数据库实验1(2021年最新版)

山东大学数据库实验1(2021年最新版)


creat table test1_student
        (  sid         char(12)  not null,
           name     varchar(10) not null,
           sex        char(2),
           age       int,
           birthday   date,
           dname     varchar(30),
           class        varchar(10) )
create table test1_course
        (  cid  char(6) not null,
           name varchar(40)  not null,
           fcid    char(6),
           credit  numeric(4,1))
create table test1_student_course
        (  sid  char(20) not null,
           cid   char(6)  not null,
           score  numeric(5,1),
           tid  char(6),
           sctime date )
insert into test1_student values(200800020101,’王欣’,’女’,19,date1994-02-02,’计算机学院’,2010);
insert into test1_student values(200800020102,’李华’,’女’,20,date1995-03-03,’软件学院’,2009);
insert into test1_course values(300001,'数据结构',null,2);

insert into test1_course values(300002,'数据库',300001,2.5);

Insert into test1_student_course values(200800020101,300001,91.5,100101);

Insert into test1_student_course values(200800020101,300002,92.6,100102);

create table a as 
select distinct sid 
from test1_student_course;
create table b as
Select distinct sid
from test1_student
minus
select sid
from a;
create view test2_01 as
select test1_student.sid,name
from test1_student cross join b
where (test1_student.sid = b.sid);

create view test2_01 as
select test1_student.sid,name
from test1_student CROSS JOIN b
where (test1_student.sid = b.sid);





  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

weixin_47373497

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值