版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、<p> Introduction to SQL Server</p><p><b> By Samuel</b></p><p> Relational databases have been around for 30 years, but they were not the original kind ofdatabase, nor are t
2、hey the newest kind of database. XML and object-oriented data structures haveevolved in recent years. But relational databases are still by far the most popular kind of database available and will be for some time to com
3、e.</p><p> SQL is the abbreviation of Structured Query Language and it is for relational databases, as the title indicates this is only for fresher who has just started the carrier or who is waiting to open
4、 up the carrier in the application programming side. But that does not mean this article is a tutorial for a fresher who does not know anything about SQL.This article is meant for who already have a little knowledge in S
5、QL and want toimprove it.</p><p> What Does SQL Do?</p><p> First, SQL is the premier tool for viewing information from a relational database. It doesn’t just give you a data dump. SQL gives y
6、ou sophisticated tools to summarize, consolidate, and calculate from the data. Using table relationships, data can be combined from multiple tables in a number of ways. With a properly designed database, SQL can answer p
7、ractically any question about the data.</p><p> Second, SQL provides commands to manipulate the data in a relational database. Records can be updated and added to or deleted from a table. Here is SQL as a d
8、atabase language really shines. Procedural programming languages, such as BASIC, might require several lines of code to update a record in a database table. In addition, procedural programming languages would have to use
9、 some sort of looping structure to repeat this process on every record. SQL operates on an entire set of records all at th</p><p> Finally, SQL is a complete data definition language (DDL). The database its
10、elf can be created along with all tables, fields, primary keys, and relationships. Add to that the record insert commands, and you can have a complete database and all its data expressed in programming code. This greatly
11、 enhances a database programmer’s ability to work remotely or to port data enhancements among various installations.</p><p> The prerequisite for learning SQL is knowledge in Discrete Mathematics (Set Theor
12、y,Relations and Functions). Although it is not necessary to learn all the theorems and proof for the theorems in the Discrete Mathematics, you should have learned the basic concepts of the Sets, Relations and Functions.
13、This will help you to learn SQL queries and fundamentals easily. If you want to explore a RDBMS more deeply you should learn Graph Theory too.</p><p> Although I tried to avoid SQL Server specific topics in
14、 this article, I am sure that some topics are pure to SQL server such as SQL Enterprise manager.</p><p> Representation of Data by DBMS</p><p> DBMS should represent the data stored by them in
15、 some form and it is most common to represent them as Column, Row, Tables and Databases. As you know SQL you know what are columns, rows, tables and database.</p><p> Primary Key</p><p> A col
16、umn or set of columns used to uniquely identify the records in a table. Primary Keys don’t allow NULL values. You can relate a table with other table if you have defined primary on it. (So defining UNIQUE and NOT NULL co
17、nstraint is not equivalent to primary key). SQL server will create a Clustered index while you create a primary key.</p><p> Primary keys should be carefully defined since based on it other relations are de
18、fined. Poorly designed primary keys will affect insert, update and delete operations. Primary keys are different from which are used for paperwork.</p><p> Foreign Key</p><p> The primary key
19、of one of the tables is almost always involved in the relationship. The field in the other table on the other end of that relationship is called the foreign key. The term</p><p> simply refers to the fact t
20、hat this field is key to relating to a foreign (or other) table. In the Lyric Music database there is a relationship between artists and titles. The ArtistID field is the primary key in the Artists table. Therefore, the
21、ArtistID field in the Titles table is a foreign key. It relates the Titles table to the primary key in the Artists table.</p><p> Most table relationships can be described as one-to-many. In a one-to-many r
22、elationship, a single record in the first table can be related to many records in the second table. However, each record in the second table relates to only one record in the first table. In addition to one-to-many relat
23、ionship, tables can have one-to-one relationships. But these are much less common.</p><p> DDL (Data Definition Language)</p><p> What is data type? – Classification of data into similar group
24、s. Names, Money,Date, Time, etc are examples for data type.</p><p> What is the use of classification or data type? – It increases the performance, reduces the space needed to store the data.</p><
25、;p> DML (Data Manipulation Language)</p><p> Data Manipulation Languages contains command used to query, change, and add data from/to the database. This includes the following commands - SELECT, INSERT,
26、 DELETE. All these commands are deals with set of data. So I want to refresh the Set theory concepts before going further.</p><p> Transactions</p><p> A transaction is a sequence of operation
27、s performed as a single logical unit of work. A logical unit of work must exhibit four properties, called the ACID (Atomicity, Consistency, Isolation, and Durability) properties, to qualify as a transaction.</p>&
28、lt;p> DTS (Data Transformation Services)</p><p> Data Transformation Services are used to transfer and transform data from one datasource to another datasoure in the same server or another server.Some a
29、pplications of DTS</p><p> 1) Copying data from one database to another database</p><p> 2) Copying data structure from one database to another database</p><p> 3) Migrating data
30、 from other datasources such as Flat File, Excel, Access, Oracle to SQL Server.</p><p> 4) Migrating data from SQL server to other datasources.</p><p> Since the DTS topic is huge you cannot g
31、et to know what it is until you do actual task that is related to DTS. So try the following things and you will get to know something about DTS. Create an Excel file with the following columns EmployeeName, Address, Date
32、OfJoin, PhoneNumber, MaritialStatus, and Department. Fill this excel sheet with some meaningful information and then try to transfer the contents from Excel to SQL using DTS Import/Export Wizard.</p><p> Yo
33、u can also create DTS packages which can be scheduled to run at future. DTS package programming allows mapping source fields to different destination fields and also provides error control.</p><p> SQL Prof
34、iler</p><p> SQL Profiler is a handy tool used to analyze what is happening inside and outside of a SQL Server. Simply it is a tool which extracts the log information from SQL server.These logs will help yo
35、u debug applications, optimize queries, redesign database structure.</p><p> Running SQL Profiler is very easy, Click SQL profiler from the SQL Server group menu. Then select New Trace from the file menu. I
36、t will open the connection dialog box. Type your server name, user name and password. Now you have to set options for your profile. The options include what events you want to trace, what columns you want in the output,
37、filters if any.</p><p> SQL server 簡(jiǎn)介</p><p><b> 塞繆爾著</b></p><p> 關(guān)系數(shù)據(jù)庫(kù)已經(jīng)存在了30年,但他們不是原種的數(shù)據(jù)庫(kù),他們也不是最新的數(shù)據(jù)庫(kù)。 XML和面向?qū)ο蟮臄?shù)據(jù)結(jié)構(gòu)在近幾年已經(jīng)發(fā)展。但是,關(guān)系數(shù)據(jù)庫(kù)仍然是迄今為止最流行的數(shù)據(jù)庫(kù),并將于今后一段時(shí)間繼續(xù)被人們所使
38、用。</p><p> SQL是結(jié)構(gòu)化查詢語言的縮寫,并且用于關(guān)系數(shù)據(jù)庫(kù)。如題目,這篇文章只是在應(yīng)用程序編程方面剛開始開發(fā)或者準(zhǔn)備開發(fā)項(xiàng)目的載體。但是,這并不意味著這篇文章能給初學(xué)者關(guān)于SQL的一個(gè)清楚的介紹。這篇文章是給那些關(guān)于SQL有一些了解,并且想提高水平的讀者讀的。</p><p><b> SQL是干什么的?</b></p><p&g
39、t; 首先,SQL是用于查看關(guān)系數(shù)據(jù)庫(kù)中的信息的首選工具。它不僅給你轉(zhuǎn)儲(chǔ)數(shù)據(jù),而且是對(duì)數(shù)據(jù)總結(jié)、鞏固和計(jì)算的先進(jìn)工具。使用表關(guān)系,數(shù)據(jù)可以從來自多個(gè)表中的許多方面被合并。SQL可以回答一個(gè)完善的數(shù)據(jù)庫(kù)幾乎所有有關(guān)數(shù)據(jù)的問題。</p><p> 其次,SQL提供了在關(guān)系數(shù)據(jù)庫(kù)中數(shù)據(jù)的命令操縱功能,記錄可以被更新并添加到一個(gè)表中或從一個(gè)表中刪除,這是作為數(shù)據(jù)庫(kù)語言SQL真正的閃光點(diǎn)。程序的編程語言,如BASIC,
40、可能需要幾行代碼來更新數(shù)據(jù)庫(kù)表的記錄。此外,程序的編程語言就必須使用一些循環(huán)結(jié)構(gòu)排序在每個(gè)記錄中重復(fù)這一過程。SQL能在同一時(shí)間操作所有記錄。 SQL對(duì)于程序員像是俳句,經(jīng)常用很多語句或更少就可以刪除或更改數(shù)千的記錄。</p><p> 最后,SQL是一個(gè)完整的數(shù)據(jù)定義語言(DDL)。該數(shù)據(jù)庫(kù)本身可以創(chuàng)建和所有表,字段,主鍵的關(guān)系。通過向該記錄插入指令添加數(shù)據(jù),你可以有一個(gè)完整的數(shù)據(jù)庫(kù)和所有編程代碼表示的數(shù)據(jù)。
41、這極大地增強(qiáng)了數(shù)據(jù)庫(kù)編程的工作能力或者各端口遠(yuǎn)程數(shù)據(jù)的改進(jìn)。</p><p> 學(xué)習(xí)SQL的先決條件是離散數(shù)學(xué)(集理論知識(shí),關(guān)系和函數(shù))。雖然沒有必要學(xué)習(xí)所有的定理和離散數(shù)學(xué)定理證明,但是應(yīng)該了解基本概念,關(guān)系和職能。這將幫助您學(xué)習(xí)SQL查詢和基本內(nèi)容。如果你想更深入探討關(guān)系數(shù)據(jù)庫(kù)管理系統(tǒng),也應(yīng)該學(xué)習(xí)圖論。</p><p> 雖然我盡力在這篇文章中避免探討SQL Server的特定主題
42、,但是我確保這篇文章涉及到關(guān)于SQL Server,例如SQL企業(yè)管理器的內(nèi)容。</p><p> 通過數(shù)據(jù)庫(kù)管理系統(tǒng)表示數(shù)據(jù)</p><p> 數(shù)據(jù)庫(kù)管理系統(tǒng)應(yīng)該代表他們?cè)谀撤N形式下存儲(chǔ)的數(shù)據(jù),最常見的代表是列,行,表格和數(shù)據(jù)庫(kù)。如你所知SQL讓您知道什么是列,行,表和數(shù)據(jù)庫(kù)。</p><p><b> 主鍵</b></p>
43、<p> 主鍵是在表中用于唯一標(biāo)識(shí)一列或者多列數(shù)據(jù)的記錄,主鍵不能為空值。如果你在一個(gè)表中定義主鍵,就可以和另外一個(gè)表相關(guān)聯(lián)(所以,定義唯一和不能為空值不等于是主鍵)。當(dāng)您創(chuàng)建一個(gè)主鍵時(shí),SQL服務(wù)器將創(chuàng)建一個(gè)聚集索引。</p><p> 在其他關(guān)系已經(jīng)定義的基礎(chǔ)上再定義主鍵的時(shí)候應(yīng)該注意。主鍵設(shè)計(jì)不當(dāng)會(huì)影響插入,更新和刪除操作。主鍵和用于文書工作的事務(wù)不同。</p><p&
44、gt;<b> 外鍵</b></p><p> 幾乎在所有的關(guān)系中都能涉及到主鍵,兩個(gè)有關(guān)系的表,一個(gè)表的主鍵是另一個(gè)表的外鍵。這個(gè)詞指的是一個(gè)表和其他表連接的關(guān)鍵區(qū)域。在抒情音樂的數(shù)據(jù)庫(kù)中有一個(gè)藝術(shù)家和標(biāo)題之間的關(guān)系。藝術(shù)家的存儲(chǔ)位置是藝術(shù)家表的主鍵,因此,藝術(shù)家的存儲(chǔ)位置在標(biāo)題表中是外鍵。它涉及標(biāo)題表到藝術(shù)家表的主鍵。</p><p> 大多數(shù)表關(guān)系可以是一
45、對(duì)多的,在一個(gè)一對(duì)多的關(guān)系中,第一個(gè)表中的一個(gè)記錄可以和第二個(gè)表中的很多記錄相對(duì),但是第二個(gè)表中的記錄只和第一個(gè)表中的一個(gè)記錄相對(duì)。除了一對(duì)多的關(guān)系,表中記錄可以是一對(duì)一的關(guān)系,但是這種情況很少見。</p><p> DDL(數(shù)據(jù)定義語言)</p><p> 什么是數(shù)據(jù)類型?—在相似群體中分類數(shù)據(jù)的群體。名稱,貨幣,日期,時(shí)間等是數(shù)據(jù)類型的例子。</p><p>
46、; 分類數(shù)據(jù)或數(shù)據(jù)類型的作用—它增加了性能,減少了存儲(chǔ)數(shù)據(jù)所需的空間。</p><p> DML(數(shù)據(jù)操作語言)</p><p> 數(shù)據(jù)操縱語言用于向數(shù)據(jù)庫(kù)添加記錄的查詢和更改命令。它包括以下命令—選擇,插入,刪除。所有這些命令都處理一組數(shù)據(jù)。所以,應(yīng)該進(jìn)一步清楚地了解集合論的概念。</p><p><b> 事務(wù)</b></p&
47、gt;<p> 事務(wù)是一個(gè)作為單個(gè)邏輯工作單元執(zhí)行的操作序列。一個(gè)邏輯工作單元必須表現(xiàn)出四個(gè)屬性,所謂的ACID(原子性,一致性,隔離性和持久性)屬性,使之成為一個(gè)事務(wù)。</p><p> DTS(數(shù)據(jù)轉(zhuǎn)換服務(wù))</p><p> 數(shù)據(jù)轉(zhuǎn)換服務(wù)是用于從一個(gè)數(shù)據(jù)的數(shù)據(jù)源到另一個(gè)在同一服務(wù)器或另一臺(tái)服務(wù)器的數(shù)據(jù)源之間傳輸和轉(zhuǎn)換的某些應(yīng)用程序。</p><
48、p> 1)從一個(gè)數(shù)據(jù)庫(kù)復(fù)制數(shù)據(jù)到另一個(gè)數(shù)據(jù)庫(kù)。</p><p> 2)從一個(gè)數(shù)據(jù)庫(kù)復(fù)制數(shù)據(jù)到另一個(gè)數(shù)據(jù)庫(kù)結(jié)構(gòu)。</p><p> 3)從其他數(shù)據(jù)源如平面文件,Excel, Access, Oracle中轉(zhuǎn)移數(shù)據(jù)到SQL Server。</p><p> 4)從SQL服務(wù)器轉(zhuǎn)移數(shù)據(jù)到其他數(shù)據(jù)源。</p><p> 在你的實(shí)際任務(wù)
49、與DTS無關(guān)時(shí),你是不知道DTS是干什么的。因此嘗試以下內(nèi)容,你會(huì)知道有關(guān)DTS的知識(shí)。創(chuàng)建一個(gè)具有下列列,員工姓名,地址,電話號(hào)碼,婚姻狀況和工作部門的表格文件。向這個(gè)表中添加一些有意義的信息表,然后嘗試使用DTS把表的內(nèi)容導(dǎo)入/導(dǎo)出SQL。</p><p> 您還可以創(chuàng)建DTS包以便以后使用,DTS包編程允許源字段映射到不同的目的地領(lǐng)域,并提供錯(cuò)誤控制。</p><p><b&
50、gt; SQL事件探查器</b></p><p> SQL事件探查器是一個(gè)用于分析SQL服務(wù)器的內(nèi)部和外部的得心應(yīng)手的工具。這是從SQL服務(wù)器提取日志信息的一個(gè)簡(jiǎn)單的工具。這些記錄會(huì)幫助你調(diào)試應(yīng)用程序,優(yōu)化查詢,重新設(shè)計(jì)數(shù)據(jù)庫(kù)結(jié)構(gòu)。</p><p> 運(yùn)行SQL事件探查器是很容易的,從SQL Server菜單中點(diǎn)擊SQL事件探查器菜單,然后從文件菜單中選擇新的連接,這將打
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 眾賞文庫(kù)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- sql_server游標(biāo)詳解
- sql server management studio express edition簡(jiǎn)介【外文翻譯】
- sql_server數(shù)據(jù)庫(kù)課程標(biāo)準(zhǔn)
- sql_server數(shù)據(jù)類型一覽表
- 計(jì)算機(jī)畢業(yè)設(shè)計(jì)外文翻譯---sql server的簡(jiǎn)介
- sql_server數(shù)據(jù)庫(kù)課程設(shè)計(jì)_圖書館管理系統(tǒng)
- 外文翻譯--在sql server數(shù)據(jù)庫(kù)里存儲(chǔ)session
- 客戶資源管理系統(tǒng)sql_server數(shù)據(jù)庫(kù)課程設(shè)計(jì)
- 計(jì)算機(jī)專業(yè)外文翻譯---sql server 2008商業(yè)智能
- 保障sql server 2000中安全的最佳做法【外文翻譯】
- 計(jì)算機(jī)專業(yè)外文翻譯---sql server的發(fā)展歷程
- sql server 2005 學(xué)習(xí)筆記之觸發(fā)器簡(jiǎn)介
- 外文翻譯---開發(fā)基于sql server 的cs數(shù)據(jù)庫(kù)應(yīng)用系統(tǒng)
- 計(jì)算機(jī)專業(yè)外文翻譯---icrosoft sql server的spss分析服務(wù)
- 外文翻譯--如何解決 SQL Server 2000 中的連接問題.doc
- 外文翻譯--如何解決 SQL Server 2000 中的連接問題.doc
- sql server 2008試題
- sql-server 聲明游標(biāo)
- sql server 實(shí)訓(xùn)作業(yè)
- sql server游標(biāo)的使用
評(píng)論
0/150
提交評(píng)論