Oracle資料庫定義語言(DDL)

來源:互聯網
上載者:User

標籤:varchar2   修改   var   lte   image   ddl   包括   sed   com   

--使用Create遇見建立表Create Table table_name(column_name datatype [null|not null],column_name datatype [null|not null],...[constraint]);--文法說明table_name:資料庫表名稱。column_name:表欄位名稱。datatype:資料列的欄位類型。[null|not null]:欄位的非空和允許為空白限制。[constraint]:設定表欄位中的約束;約束包括:主鍵約束、外鍵約束、檢查約束等。--執行個體create table Product(PdtId int,PdtName nvarchar2(20),constraint pk_product_pdtid primary key (PdtId));--使用drop刪除表Drop table table_name;--執行個體Drop table Product;--使用Alter修改表資訊Alter table table_nameAdd column_name | Modify column_name | Drop column column_name;--文法說明Add:用於添加表欄位。Modify:用來修改表欄位的類型。Drop column:刪除表裡的列,如果在表中列加上cascade constraints就是把與該列有關的約束也一併刪除掉。
View Code

 

Oracle資料庫定義語言(DDL)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.