oracle 創建表

1、oracle創建表

   格式:create table xxx

        (

         xxx_id        char(10)    not null,

         ……

         xxx_name      char(20)    not null,

         xxx_address   char(100)   null

        )

例:創建客戶信息表

CREATE TABLE studens

(

  studens_id      char(10)  NOT NULL ,

  studens_name    char(50)  NOT NULL ,

  studens_address char(50)  NULL ,

  studens_city    char(50)  NULL ,

  studens_country char(50)  NULL ,

  studens_email   char(255) NULL 

);

說明:根據需求,預設表字段,針對每個字段設置字符類型,表的列可設置爲空或者不爲空。

      創建表時,最後一個字段定義完畢,null或者not null後面有分號,否則會有如下提示:

      wKiom1j6FJ6A-CNhAAAhwX1vDP0968.png-wh_50


     


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章