1.使用SQL语句创建表

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_29956725/article/details/88028816

1.创建表的语法

   
     create table 表名 (列1 数据类型  1,列2  数据类型)   tablespace  表空间

   SQL:create table student
            ( ID NUMBER  not null,
              NAME VARCHAR2(20)
           );
      表已创建

    

    

      desc  查看表结构

2.   SQL:desc  student;

      

3.  alter table   student add(系号   NUMBER  Not  null);

 
4. 修改列的类型
alter table student  modify(dept varchar2(20));

 
5. 重命名列名称
 
SQL> alter table  student rename column dept to dept01;

扫描二维码关注公众号,回复: 5544556 查看本文章


6. 删除已有列

  alter table student drop column dept;

7. 删除数据表

  drop  table student;

猜你喜欢

转载自blog.csdn.net/qq_29956725/article/details/88028816