資料庫(linux)

來源:互聯網
上載者:User

標籤:bubuko   刪除表格   分享圖片   大小   creat   erer   查看   text   lob   

 

層次型資料庫

       樹狀的。1:N

網狀資料庫

      網狀的。可以通過數學方法轉換成層次資料庫

關聯式資料庫

      把關聯式資料庫關係,轉換成簡單的二次模式

     DbaseIII;foxbase;Access orcle mysql   lotus  sql  orcle  mysql sqlite3  

     LAmp  linux  apache   mysql   php    tomcat    JAVA 

 

建立或選擇資料庫

        sqlite3     study.db

查看資料庫

       .databases

退出資料庫

        .quit 

 

建立表格

create    table    department (

INT

CHAR

TEXT

REAL

)

查看錶格

       .table

查看錶格結構

      .schema  comany

查所有表格結構

      .schema

刪除表格

       drop table  department;

向表格插入內容

  1.       insert  into  company values  (.............)values(.........................)
  2.       insert  into  company  values  (..........................);

格式控制

      .head   on 

      .mode   column

尋找表格內容

        select  *from   company

where子句

  1.          select * from company  where id=  7;
  2.      運算子:>  <   >=   <=   and  or   not  like    glob   exists
  3.          select *  from company   where  age=    in (25,27);
  4.      年齡為25 或 27 歲的
  5.          select *  from companny  where  age  between  22  and  27;
  6.       年齡22——27
  7.           select * from  company  where  age  not  null;
  8.       年齡不可為空 
  9.           select * from   company  where  exists(select age  company  wherer  salary  >65000);

 

like子語句和glob 子語句

  1.           select  * from   company  where   name  like  ‘P%‘;大小寫不敏感
  2.           select   * from  company   where  glob  ‘P*’;

limit語句

            限制合格返回量

  1.            select * from   company  where  age <30 limit 2;
  2.            select *  from  company   limit 2;
  3.           select *from   compay   limit  2  offset  2;

order  by  子句

         asc   升序    DeSc     降序

 

資料庫(linux)

聯繫我們

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