Oracle基本語句

來源:互聯網
上載者:User

標籤:oracle   基本語句   sql

dept 部門表

SQL語句的分類

     1資料操縱語言   DML

      insert  (插入記錄)

      insert  into dept (deptNo,deptName,loc)values (28,‘教學部‘,’珠海‘)

      

      update  (修改記錄)

      update   dept set    deptNo=38  where deptNo=28


      delete    (刪除記錄)

      delete from dept where deptNo=38


查詢語句

      select depNo,deptName,loc from dept  where deptNo<50;


資料定義語言 (Data Definition Language) DDL 

      create    建立資料庫結構

      alter     修改資料庫結構

      drop      刪除資料庫結構

      rename    給表重新命名

      truncate  刪除表的資料 


    create   table   testTab (

                             ID  int,

                             c1  varchar2(50),

                             c2  date

                             )


     alter   table    testTab add  c3 decimal(15,2)



     drop  table testTab

      

     rename emp    to   employess

            (表名稱)       (表名稱)


     truncate  table   emp


事物控制(TC)

     commit    (永久性的儲存對行所做的修改)

       insert  into  dept   values(88,‘營運部’,‘HK’)

       rollback

       撤銷 ,復原

       commit      提交(提交後在復原無任何意義)

    savepoint


  

資料控制語言(DCL) 

grant   授予其他使用者對資料庫結構訪問的許可權

revoke  主要是阻止其他使用者訪問資料庫結構



變數聲明

條件控制

迴圈

過程和函數的定義

 




















本文出自 “代碼的那些事兒” 部落格,請務必保留此出處http://hw168.blog.51cto.com/10425348/1673217

Oracle基本語句

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.