大家好,欢迎大家来和我一起探讨SQL数据库的一些小知识点,大家还可以加入[url=http://www.jisuanjixuexiao.com]计算机学校[/url]与我们交流。

SQL:
    .mdf-主数据文件(1个)   .ldf-事务日志文件     .ndf-次数据文件(很多个)

    附加-添加数据文件       分离-移除数据文件

    标识列-自动增加 + 类型有限制(int……)
 -----------------------------------------------------------------------
    use  库名字  - 使用某个数据库
 -----------------------------------------------------------------------

    select  内容  from  表名  [where  条件] [order by 列名 ASC | DESC]
             *

    select  内容 as 新列名  from  表名 

    select  内容  from  表名  [where  is null]
                                      is not null
                                      >  <   =  <>
                                      like  '_c'
                                      like  '%c'

    select  内容+  '来源于'  +内容  as  新列名  from  表名
 ------------------------------------------------------------------------
    insert  [into]  表名 (列名,列名)  values(列表值,列表值)
 ------------------------------------------------------------------------
    insert  into 表名 (列名,列名)    备注:该表必须提前建立
    select  内容  from  表名  [where  条件] 
 ------------------------------------------------------------------------
    select 内容  into 新表名  from  表名    备注:该新表无须提前建立
 ------------------------------------------------------------------------
    union 联合   
 ------------------------------------------------------------------------
    update  表名  set 列名=列表更新值  [where  条件]    
 ------------------------------------------------------------------------
    delete  from  表名  [where  条件]
    备注:根据条件可以删除某些行

    delete  from  表名  (删除所有内容)
 ------------------------------------------------------------------------
    truncate  table  表名
    备注:删除表中所有内容
 ------------------------------------------------------------------------
    drop  table  表名
    备注:删除表