晓yi吧 关注:10贴子:922
  • 4回复贴,共1

不看动漫永远不会懂

只看楼主收藏回复





IP属地:福建1楼2012-08-24 13:28回复


    IP属地:安徽2楼2012-08-24 23:44
    回复
      create database spj
      use spj
      create table student
      ( sno char(9) primary key,
      sname char(20) not null,
      ssex char(2),
      sage smallint,
      sdept char(20)
      );
      create table sc
      (sno char(9) not null,
      cno char(4) not null,
      grade smallint,
      primary key (sno,cno)
      ) ;
      create table course
      (cno char(4) primary key,
      cname char(40),
      cpno char(4),
      ccredit smallint,
      foreign key (cpno) references course(cno)
      );
      create table sc1
      (sno char(9) not null,
      cno char(4) not null,
      grade smallint,
      primary key (sno,cno),
      foreign key(sno) references student(sno),
      foreign key(cno) references course(cno),
      );
      create table sc2
      (sno char(9) not null,
      cno char(4) not null,
      grade smallint,
      primary key (sno,cno),
      foreign key(sno) references student(sno)
      on delete cascade
      on update cascade,
      foreign key(cno) references course(cno)
      on delete no action
      on update cascade
      );
      create table dept
      (deptno numeric(2),
      dname char(9) unique,
      location char(10),
      primary key(deptno)
      );
      create table student1
      (sno char(9) primary key,
      sname char(8) not null,
      ssex char(2) check (ssex in('男','女')),
      sage smallint,
      sdept char(20)
      );
      create table sc3
      (sno char(9) not null,
      cno char(4) not null,
      grade smallint check (grade>=0 and grade<=100),
      primary key(sno,cno),
      foreign key (sno) references student1(sno),
      foreign key (cno) references course(cno)
      )
      create table student2
      (sno char(9),
      sname char(8) not null,
      ssex char(2),
      sage smallint,
      sdept char(20),
      primary key (sno),
      check(ssex='女'or sname not like'ms.%')
      );
      create table student3
      (sno numeric(6),
      constraint c1 check (sno between 90000 and 99999),
      sname char(20)
      constraint c2 not null,
      sage numeric(3)
      constraint c3 check(sage<30),
      ssex char(2)
      constraint c4 check (ssex in('男','女')),
      constraint studentkey primary key (sno)
      );
      create table teacher
      (eno numeric(4) primary key,
      ename char(10),
      job char(8),
      sal numeric(7,2),
      deduct numeric(7,2),
      deptno numeric(2),
      constraint empfkey foreign key(deptno) references dept(deptno),
      constraint c5 check (sal+deduct >=300)
      );
      alter table student3
      drop constraint c4;
      alter table student3
      drop constraint c1;
      alter table student3
      add constraint c1 check(sno between 900000 and 999999);
      alter table student3
      drop constraint c3;
      alter table student3
      add constraint c3 check(sage <40); create trigger insert_or_update_sal
      before insert or update on teacher
      for each row
      begin
      if(new.job='教授')and (new.sal<4000) then
      new.sal:=4000;
      end if;
      end; create table sal_log
      (
      eno numeric(4) references teacher(eno),
      sal numeric(7,2),
      username char(10),
      date timestamp
      );
      create trigger insert_sal
      after insert on teacher
      for each row
      as begin
      insert into sal_log values(new.eno,new.sal,current_user,current_timestamp);
      end; create trigger update_sal
      after update on teacher
      for ench row
      as begin
      if(new.sal<>old.sal) then insert into sal_log values(new.eno,new.sal,current_user,current_timestamp);
      end if;
      end;


      IP属地:福建3楼2012-12-06 15:22
      回复
        IP属地:福建4楼2012-12-06 15:35
        回复
          呵呵。看了不同情你的就是没看贴子?这贴标题已经明显黑了整个公会。我有没有偷换概念轮不着你说。我@ 了人让他们来评判。还偷换概念?这种跟公会有管理层矛盾开这么明显贴子带着整个公会一起黑的什么心态。VC会长为了减少影响公会已经各种道歉你还没完没了。你怕什么,吧务来了你继续装可怜装委屈啊?继续揭露人家老底啊?有本事让吧务也同情你。但是你终究还是因为私人矛盾黑公会。@原版女妖 假如你会里管理跟人吵架,你带替道歉,他还依旧连带公会一起黑。你什么感想。


          IP属地:福建5楼2013-02-04 10:56
          回复