資料庫---SQL Server

來源:互聯網
上載者:User

標籤:

資料庫:分為 層次型,網狀型,關係型。現在通常都是使用關係型

常用的:SQLServer,Oracle,DB2,Access,Visual Foxpro,MySQL

SQL:Structured Query Language

SQL Server 是一種大型的資料庫軟體,是用來管理和修改資料庫的

SQL Server 登陸的幾要素:

1.伺服器類型——資料庫引擎
2.伺服器名稱——本機.或(local),遠程機電腦名稱或IP
3.身分識別驗證——Windows身分識別驗證(管理員使用),SqlServer身分識別驗證(開發人員)
4.使用者名稱:sa - 超級管理員
5.密碼:

如何開啟SQLServer身分識別驗證?
1.在伺服器屬性中,修改身分識別驗證模式。SqlServer和Windows身分識別驗證。
2.啟用sa帳號的兩個功能:授予訪問資料庫。啟用登入。
3.修改sa的登入密碼

SQLServer的三層結構:
1.硬碟Data檔案夾中的.mdf。儲存資料的地方。
2.SqlServer的服務。
3.資料庫管理介面

建立資料庫:

格式:create database 資料庫名  -----大小寫不敏感

檔案類型:
1.主要資料檔案:.mdf    只有一個
2.次資料檔案:.ndf     可以有多個
3.記錄檔:   .ldf      可以有多個

資料類型:
int :int, smallint, bigint, tinyint
double :float ,real ,decimal
bool : bit (只包括 0 或 1 ,可以用bit資料類型代表 ture 或 false)
string :char ,varchar, nchar ,nvarchar ,text (一般使用varchar,固定長度時使用char)
datetime :datetime (1753-1-1,9999-12-31) ,smalldatetime (1900-1-1,2079-6-6)
binnary /image :  二進位,大型二進位

刪除資料庫:drop database 資料庫名

修改資料庫:alter database 資料庫名

建表:creat table 表名

改表:alter table 表名

刪表:drop table 表名

 

資料庫---SQL Server

聯繫我們

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