av在线免费观看青青草原,欧美夫妻性生活视频网,免费看美女被考到爽的视频

午夜在线视频一区二区-亚洲一区成人免费电影-超碰欧美一区二区三区-大香蕉大香蕉日本大香蕉

<delect id="4ssqo"></delect>
<dl id="4ssqo"><strong id="4ssqo"></strong></dl>
<dl id="4ssqo"></dl>
  • <tbody id="4ssqo"><th id="4ssqo"></th></tbody>

    獲得積分
    資料庫(kù)會(huì)員登錄
    搜索: [高級(jí)搜索]
    下載首頁(yè) | 資源分類 | 下載排行
    您的位置: 首頁(yè) > 信息化技術(shù) > MSSQL
     
    分類導(dǎo)航
    下載排行
    最新資源
    數(shù)據(jù)庫(kù)知識(shí)(SQL)培訓(xùn)
    資源大小:12.56 KB 資源類型:文檔
    下載積分: 0
    更多
    -->
    下載統(tǒng)計(jì):總下載:0,本月下載:0,本周下載:0,今日下載:0
    發(fā)表評(píng)論 錯(cuò)誤報(bào)告 加入收藏夾
    資源介紹
    數(shù)據(jù)庫(kù)知識(shí)(SQL)
    一、SQL
    SQL工具
    數(shù)據(jù)備份、還原、導(dǎo)入、導(dǎo)出與跟蹤。
    1、SQL工具
    企業(yè)管理器:
    查詢分析器
    事件探查器
    數(shù)據(jù)導(dǎo)入與導(dǎo)出
    2、數(shù)據(jù)備份以及還原
    備份①自動(dòng)備份
            ②手功備份
    還原
    附加
    3、SQL 語(yǔ)句(DDL,DML,DCL)
         Select 語(yǔ)句(group by ,having,order by asc/desc,union,union all,top,distinct,all)
         Update: update a set
         Delete: delete from tablename where ..
         Create :create table tablename (column1,datatype)
         Insert : insert into tablename () values ()
         Drop:drop table tablename
    Alter:alter table <表名> alter column <字段名> 新類型名(長(zhǎng)度)
          Alte table <表名> add  <字段名> 新類型名(長(zhǎng)度)
    4、視圖: create or replace view viewname as select ….
    5、:create or replace trigger trname after/before insert/unpdate/delete on tablename
         Begin
           If insert /update/delete
         End;
    6、過(guò)程 create or replace procedure procedure_name
    (parameter1 in 數(shù)據(jù)類型,.....)
    begin
             sql 語(yǔ)句
    end procedure_name
    7、系統(tǒng)表:sql:sysobjects
    8、一表中怎樣用sql語(yǔ)句刪除重復(fù)的數(shù)據(jù),只保留其中的一條數(shù)據(jù)
    select   distinct   *     
      into   #temp   
      from   t1   
      order   by   s_id      
       
      /*刪除原表的數(shù)據(jù)*/   
      delete   from   t1   
       
      /*將甩選的數(shù)據(jù)插入原表   
      insert     
      t1   
      select   *   
      from   #temp   
       
      /*刪除臨時(shí)表   
      drop   table   #temp

    二、數(shù)據(jù)類型
    smallint -- 16 位元的整數(shù)。
    interger -- 32 位元的整數(shù)。
    decimal(p,s) -- p 精確值和 s 大小的十進(jìn)位整數(shù),精確值p是指全部有幾個(gè)數(shù)(digits)大小值,s是指小數(shù)點(diǎn)後有幾位數(shù)。如果沒有特別指定,則系統(tǒng)會(huì)設(shè)為 p=5; s=0 。  
    float -- 32位元的實(shí)數(shù)。
    double -- 64位元的實(shí)數(shù)。
    char(n) -- n 長(zhǎng)度的字串,n不能超過(guò) 254。
    varchar(n) -- 長(zhǎng)度不固定且其最大長(zhǎng)度為 n 的字串,n不能超過(guò) 4000。
    graphic(n) -- 和 char(n) 一樣,不過(guò)其單位是兩個(gè)字元 double-bytes, n不能超過(guò)127。這個(gè)形態(tài)是為了支援兩個(gè)字元長(zhǎng)度的字體,例如中文字。
    vargraphic(n) -- 可變長(zhǎng)度且其最大長(zhǎng)度為 n 的雙字元字串,n不能超過(guò) 2000。
    date -- 包含了 年份、月份、日期。
    time -- 包含了 小時(shí)、分鐘、秒。
    timestamp -- 包含了 年、月、日、時(shí)、分、秒、千分之一秒。

    三、數(shù)據(jù)定義
    1、建表格:
    create table table_name(  
    column1 datatype [not null] [not null primary key],  
    column2 datatype [not null],
    ...)
    說(shuō)明: 
    datatype --是資料的格式,詳見表。
    nut null --可不可以允許資料有空的(尚未有資料填入)。
    primary key --是本表的主鍵。

    2、更改表格 
    alter table table_name  
    add column column_name datatype  
    說(shuō)明:增加一個(gè)欄位(沒有刪除某個(gè)欄位的語(yǔ)法。
    alter table table_name
    add primary key (column_name)
    說(shuō)明:更改表得的定義把某個(gè)欄位設(shè)為主鍵。
    alter table table_name
    drop primary key (column_name)
    說(shuō)明:把主鍵的定義刪除。
    alter table <表名> alter column <字段名> 新類型名(長(zhǎng)度)
    alter table zy_bh0 add bz varchar (30)
    alert table zy_bh0 alert column bz carchar (50)

    3、建立索引 
    create index index_name on table_name (column_name)
    說(shuō)明:對(duì)某個(gè)表格的欄位建立索引以增加查詢時(shí)的速度。

    4、刪除 
    drop table_name
    drop index_name

    四、數(shù)據(jù)操作
       數(shù)據(jù)的操作不外乎增加數(shù)據(jù)(insert)、查詢數(shù)據(jù)(query)、更改數(shù)據(jù)(update) 、刪除數(shù)據(jù)(delete)四種模式,以下分 別介紹他們的語(yǔ)法:

    1、增加數(shù)據(jù)
    insert into table_name (column1,column2,...)
    values ( value1,value2, ...)
    說(shuō)明:
        1.若沒有指定column 系統(tǒng)則會(huì)按表格內(nèi)的欄位順序填入數(shù)據(jù)。
        2.欄位的數(shù)據(jù)形態(tài)和所填入的數(shù)據(jù)必須吻合。
        3.table_name 也可以是景觀 view_name。

        insert into table_name (column1,column2,...)
        select columnx,columny,... from another_table
        說(shuō)明:也可以經(jīng)過(guò)一個(gè)子查詢(subquery)把別的表格的數(shù)據(jù)填入。

    2、查詢數(shù)據(jù)
    基本查詢
    select column1,columns2,...
    from table_name
    說(shuō)明:把table_name 的特定欄位數(shù)據(jù)全部列出來(lái)
    select *
    from table_name
    where column1 = xxx  
    [and column2 >; yyy] [or column3 <>; zzz]
    說(shuō)明:
    下載地址
     下載地址1
    按字母檢索

    下載須知:
    大部份資源無(wú)需注冊(cè)即可下載
    需要積分的資源要在會(huì)員中心注冊(cè)會(huì)員并用 積分體系中提示的方法賺取積分才能下載。

    免責(zé)聲明:
    所有資源只能用于參考學(xué)習(xí),不能用于任何商業(yè)用途,否則后果自負(fù)!