0526yao

 

 第一问

//登陆scott用户

//解锁
alter user scott account unlock;

//给用户申请密码
alter user scott identified by tiger;

//连接
conn scott/tiger;
//创建student表 
create table student
    (
    sno char(10) not null,
    sname varchar(8) ,
    sex char(2) default \'男\' check(sex=\'男\' or sex=\'女\'),
    birthday date,
    sdept char(20),
    Constraint stu_pk primary key (sno)
  );
//创建Courser表 
create table course(
    eno char(10) primary key,
    ename char(30) Constraint cname_UK unique,
    ccredit number(3),
   );

 

//创建score表 
create table score(
    sno char(10) not null,
    cno char(10) not null,
    grade number(3) check(grade>0 and grade < 100),
    Constraint sco_pk primary key(sno,cno)
   );

 第二问

alter table student add(memo varchar2(200));


alter table student modify memo varchar2(300);

//查看表
desc student;


alter table student drop(memo);

//查看表
desc student;

 

分类:

技术点:

相关文章:

  • 2021-06-26
  • 2021-10-18
  • 2021-10-18
  • 2022-01-07
  • 2018-12-02
  • 2021-09-18
  • 2022-01-27
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-13
  • 2021-10-18
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案