亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ch19.htm

?? 21精通SQL
?? HTM
?? 第 1 頁 / 共 4 頁
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>

<HEAD>
	
	<TITLE>Teach Yourself SQL in 21 Days, Second Edition -- Ch 19 -- Transact-SQL: An Introduction</TITLE>
</HEAD>

<BODY TEXT="#000000" BGCOLOR="#FFFFFF">

<CENTER>
<H1><IMG SRC="sams.gif" tppabs="http://202.113.16.101/%7eeb%7e/Teach%20Yourself%20MS%20SQL%20Server%206.5%20in%2021%20Days/sams.gif" WIDTH="171" HEIGHT="66" ALIGN="BOTTOM" BORDER="0"><BR>
<FONT COLOR="#000077">Teach Yourself SQL in 21 Days, Second Edition</FONT></H1>
</CENTER>
<CENTER>
<P><A HREF="ch18.htm" tppabs="http://202.113.16.101/%7eeb%7e/Teach%20Yourself%20MS%20SQL%20Server%206.5%20in%2021%20Days/ch18.htm"><IMG SRC="previous.gif" tppabs="http://202.113.16.101/%7eeb%7e/Teach%20Yourself%20MS%20SQL%20Server%206.5%20in%2021%20Days/previous.gif" WIDTH="128" HEIGHT="28"
ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="ch20.htm" tppabs="http://202.113.16.101/%7eeb%7e/Teach%20Yourself%20MS%20SQL%20Server%206.5%20in%2021%20Days/ch20.htm"><IMG
SRC="next.gif" tppabs="http://202.113.16.101/%7eeb%7e/Teach%20Yourself%20MS%20SQL%20Server%206.5%20in%2021%20Days/next.gif" WIDTH="128" HEIGHT="28" ALIGN="BOTTOM" ALT="Next chapter"
BORDER="0"></A><A HREF="index-1.htm" tppabs="http://202.113.16.101/%7eeb%7e/Teach%20Yourself%20MS%20SQL%20Server%206.5%20in%2021%20Days/index-1.htm"><IMG SRC="contents.gif" tppabs="http://202.113.16.101/%7eeb%7e/Teach%20Yourself%20MS%20SQL%20Server%206.5%20in%2021%20Days/contents.gif" WIDTH="128"
HEIGHT="28" ALIGN="BOTTOM" ALT="Contents" BORDER="0"></A> 
<HR>

</CENTER>
<CENTER>
<H1><FONT COLOR="#000077">- Day 19 -<BR>
Transact-SQL: An Introduction</FONT></H1>
</CENTER>
<H2><FONT COLOR="#000077">Objectives</FONT></H2>
<P>Today's material supplements the previous presentations, as Transact-SQL is a
supplement to the accepted SQL standard. Today's goals are to

<UL>
	<LI>Identify one of the popular extensions to SQL
	<P>
	<LI>Outline the major features of Transact-SQL
	<P>
	<LI>Provide practical examples to give you an understanding of how Transact-SQL is
	used
</UL>

<H2><FONT COLOR="#000077">An Overview of Transact-SQL</FONT></H2>
<P>Day 13, &quot;Advanced SQL Topics,&quot; briefly covered static SQL. The examples
on Day 13 depicted the use of embedded SQL in third-generation programming languages
such as C. With this method of programming, the embedded SQL code does not change
and is, therefore, limited. On the other hand, you can write dynamic SQL to perform
the same functions as a procedural programming language and allow conditions to be
changed within the SQL code.</P>
<P>As we have mentioned during the discussion of virtually every topic in this book,
almost every database vendor has added many extensions to the language. Transact-SQL
is the Sybase and Microsoft SQL Server database product. Oracle's product is PL/SQL.
Each of these languages contains the complete functionality of everything we have
discussed so far. In addition, each product contains many extensions to the ANSI
SQL standard.
<H2><FONT COLOR="#000077">Extensions to ANSI SQL</FONT></H2>
<P>To illustrate the use of these SQL extensions to create actual programming logic,
we are using Sybase and Microsoft SQL Server's Transact-SQL language. It contains
most of the constructs found in third-generation languages, as well as some SQL Server-specific
features that turn out to be very handy tools for the database programmer. (Other
manufacturers' extensions contain many of these features and more.)
<H3><FONT COLOR="#000077">Who Uses Transact-SQL?</FONT></H3>
<P>Everyone reading this book can use Transact-SQL--casual relational database programmers
who occasionally write queries as well as developers who write applications and create
objects such as triggers and stored procedures.


<BLOCKQUOTE>
	<P>
<HR>
<FONT COLOR="#000077"><B>NOTE:</B></FONT><B> </B>Users of Sybase and Microsoft SQL
	Server who want to explore the true capabilities of relational database programming
	must use the Transact-SQL features. 
<HR>


</BLOCKQUOTE>

<H3><FONT COLOR="#000077">The Basic Components of Transact-SQL</FONT></H3>
<P>SQL extensions overcome SQL's limits as a procedural language. For example, Transact-SQL
enables you to maintain tight control over your database transactions and to write
procedural database programs that practically render the programmer exempt from exhausting
programming tasks.</P>
<P>Day 19 covers the following key features of Transact-SQL:

<UL>
	<LI>A wide range of data types to optimize data storage
	<P>
	<LI>Program flow commands such as loops and <TT>IF-ELSE</TT> statements
	<P>
	<LI>Use of variables in SQL statements
	<P>
	<LI>Summarized reports using computations
	<P>
	<LI>Diagnostic features to analyze SQL statements
	<P>
	<LI>Many other options to enhance the standard language of SQL
</UL>

<H2><FONT COLOR="#000077">Data Types</FONT></H2>
<P>On Day 9, &quot;Creating and Maintaining Tables,&quot; we discussed data types.
When creating tables in SQL, you must specify a specific data type for each column.


<BLOCKQUOTE>
	<P>
<HR>
<FONT COLOR="#000077"><B>NOTE:</B></FONT><B> </B>Data types vary between implementations
	of SQL because of the way each database server stores data. For instance, Oracle
	uses selected data types, whereas Sybase and Microsoft's SQL Server have their own
	data types. 
<HR>


</BLOCKQUOTE>

<P>Sybase and Microsoft's SQL Server support the following data types.
<H3><FONT COLOR="#000077">Character Strings</FONT></H3>

<UL>
	<LI><TT>char</TT> stores fixed-length character strings, such as STATE abbreviations,
	when you know that the column will always be two characters.
	<P>
	<LI><TT>varchar</TT> stores variable-length character strings, such as an individual's
	name, where the exact length of a name is not specified, for example, AL RAY to WILLIAM
	STEPHENSON.
	<P>
	<LI><TT>text</TT> stores strings with nearly unlimited size, such as a remarks column
	or description of a type of service.
</UL>

<H3><FONT COLOR="#000077">Numeric Data Types</FONT></H3>

<UL>
	<LI><TT>int</TT> stores integers from <TT>-2</TT>,<TT>147</TT>,<TT>483</TT>,<TT>647</TT>
	to <TT>+2</TT>,<TT>147</TT>,<TT>483</TT>,<TT>647</TT>.
	<P>
	<LI><TT>smallint</TT> stores integers from <TT>-32,768</TT> to <TT>32,767</TT>.
	<P>
	<LI><TT>tinyint</TT> stores integers from <TT>0</TT> to <TT>255</TT>.
	<P>
	<LI><TT>float</TT> expresses numbers as real floating-point numbers with data precisions.
	Decimals are allowed with these data types. The values range from <TT>+2.23E-308</TT>
	to <TT>+1.79E308</TT>.
	<P>
	<LI><TT>real</TT> expresses real numbers with data precisions from <TT>+1.18E-38</TT>
	to <TT>+3.40E38</TT>.
</UL>

<H3><FONT COLOR="#000077">DATE Data Types</FONT></H3>

<UL>
	<LI><TT>datetime</TT> values range from <TT>Jan 1, 1753</TT> to <TT>Dec 31, 9999</TT>.
	<P>
	<LI><TT>smalldatetime</TT><B> </B>values range from <TT>Jan 1, 1900</TT> to <TT>Jun
	6, 2079</TT>.
</UL>

<H3><FONT COLOR="#000077">Money Data Types</FONT></H3>

<UL>
	<LI><TT>money</TT><B> </B>stores<B> </B>values up to <TT>+922,337,203,685,477.5808</TT>.
	<P>
	<LI><TT>smallmoney</TT><B> </B>stores<B> </B>values up to <TT>+214,748.3647</TT>.
</UL>

<P>Money values are inserted into a table using the dollar sign; for example:</P>
<PRE><FONT COLOR="#0066FF">insert payment_tbl (customer_id, paydate, pay_amt)
values (012845, &quot;May 1, 1997&quot;, $2099.99)
</FONT></PRE>
<H3><FONT COLOR="#000077">Binary Strings</FONT></H3>

<UL>
	<LI><TT>binary</TT> stores fixed-length binary strings.
	<P>
	<LI><TT>varbinary</TT> stores variable-length binary strings.
	<P>
	<LI><TT>image</TT> stores very large binary strings, for example, photographs and
	other images.
</UL>

<H3><FONT COLOR="#000077">bit: A Logical Data Type</FONT></H3>
<P>The data type <TT>bit</TT> is often used to flag certain rows of data within a
table. The value stored within a column whose data type is <TT>bit</TT> is either
a <TT>1</TT> or <TT>0</TT>. For example, the value <TT>1</TT> may signify the condition
true, whereas <TT>0</TT> denotes a false condition. The following example uses the
<TT>bit</TT> data type to create a table containing individual test scores:</P>
<PRE><FONT COLOR="#0066FF">create table test_flag
( ind_id int not null,
  test_results int not null,
  result_flag bit not null)
</FONT></PRE>
<H5>ANALYSIS:</H5>
<P>The column <TT>result_flag</TT> is defined as a <TT>bit</TT> column, where the
<TT>bit</TT> character represents either a pass or fail, where pass is true and fail
is false.</P>
<P>Throughout the rest of the day, pay attention to the data types used when creating
tables and writing Transact-SQL code.


<BLOCKQUOTE>
	<P>
<HR>
<FONT COLOR="#000077"><B>NOTE:</B></FONT><B> </B>The code in today's examples uses
	both uppercase and lowercase. Although SQL keywords are not case sensitive in most
	implementations of SQL, always check your implementation. 
<HR>


</BLOCKQUOTE>

<H2><FONT COLOR="#000077">Accessing the Database with Transact-SQL</FONT></H2>
<P>All right, enough talk. To actually run the examples today, you will need to build
the following database tables in a database named <TT>BASEBALL</TT>.
<H3><FONT COLOR="#000077">The BASEBALL Database</FONT></H3>
<P>The <TT>BASEBALL</TT> database consists of three tables used to track typical
baseball information: the <TT>BATTERS</TT> table, the <TT>PITCHERS</TT> table, and
the <TT>TEAMS</TT> table. This database will be used in examples throughout the rest
of today.
<H4><FONT COLOR="#000077">The BATTERS TABLE</FONT></H4>
<PRE><FONT COLOR="#0066FF">NAME char(30)
TEAM int
AVERAGE float
HOMERUNS int
RBIS int
</FONT></PRE>
<P>The table above can be created using the following Transact-SQL statement:</P>
<H5>INPUT:</H5>
<PRE><FONT COLOR="#0066FF">1&gt; <B>create database BASEBALL on default</B>
2&gt; <B>go</B>
1&gt; <B>use BASEBALL</B>
2&gt; <B>go</B>
1&gt; <B>create table BATTERS (</B>
2&gt; <B>NAME char(30),</B>
3&gt; <B>TEAM int,</B>
4&gt; <B>AVERAGE float,</B>
5&gt; <B>HOMERUNS int,</B>
6&gt; <B>RBIS int)</B>
7&gt; <B>go</B>
</FONT></PRE>
<H5>ANALYSIS:</H5>
<P>Line 1 creates the database. You specify the database <TT>BASEBALL</TT> and then
create the table <TT>BATTERS</TT> underneath <TT>BASEBALL</TT>.</P>
<P>Enter the data in Table 19.1 into the <TT>BATTERS</TT> table.


<BLOCKQUOTE>
	<P>
<HR>
<FONT COLOR="#000077"><B>NOTE:</B></FONT><B> </B>The command <TT>go</TT> that separates
	each Transact-SQL statement in the preceding example is not part of Transact-SQL.
	<TT>go</TT>'s purpose is to pass each statement from a front-end application to SQL
	Server. 
<HR>


</BLOCKQUOTE>

<H4><FONT COLOR="#000077">Table 19.1. Data for the BATTERS table.</FONT></H4>
<P>
<TABLE BORDER="1">
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT"><B>Name</B></TD>
		<TD ALIGN="LEFT"><B>Team</B></TD>
		<TD ALIGN="LEFT"><B>Average</B></TD>
		<TD ALIGN="LEFT"><B>Homeruns</B></TD>
		<TD ALIGN="LEFT"><B>RBIs</B></TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT">Billy Brewster</TD>
		<TD ALIGN="LEFT">1</TD>
		<TD ALIGN="LEFT">.275</TD>
		<TD ALIGN="LEFT">14</TD>
		<TD ALIGN="LEFT">46</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT">John Jackson</TD>
		<TD ALIGN="LEFT">1</TD>
		<TD ALIGN="LEFT">.293</TD>
		<TD ALIGN="LEFT">2</TD>
		<TD ALIGN="LEFT">29</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT">Phil Hartman</TD>
		<TD ALIGN="LEFT">1</TD>
		<TD ALIGN="LEFT">.221</TD>
		<TD ALIGN="LEFT">13</TD>
		<TD ALIGN="LEFT">21</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT">Jim Gehardy</TD>
		<TD ALIGN="LEFT">2</TD>
		<TD ALIGN="LEFT">.316</TD>
		<TD ALIGN="LEFT">29</TD>
		<TD ALIGN="LEFT">84</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT">Tom Trawick</TD>
		<TD ALIGN="LEFT">2</TD>
		<TD ALIGN="LEFT">.258</TD>
		<TD ALIGN="LEFT">3</TD>
		<TD ALIGN="LEFT">51</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT">Eric Redstone</TD>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲美女偷拍久久| 日本久久电影网| 色94色欧美sute亚洲线路一ni| 欧美日韩亚洲国产综合| 欧美高清在线视频| 热久久一区二区| 欧美日韩在线播放三区| 国产精品青草久久| 国产精品自拍一区| 日韩欧美一区二区不卡| 亚洲一区在线看| 99久久婷婷国产综合精品电影| 日韩欧美国产三级电影视频| 一区二区三区在线高清| 99国产精品久久| 国产欧美精品一区| 国模一区二区三区白浆| 91精品国产综合久久香蕉麻豆 | 日本精品一级二级| 国产精品无人区| 国产成人精品免费一区二区| 精品日韩欧美一区二区| 日本不卡一二三区黄网| 6080yy午夜一二三区久久| 亚洲午夜电影网| 欧美日韩一区成人| 亚洲妇女屁股眼交7| 欧美喷水一区二区| 亚洲午夜av在线| 欧美激情在线免费观看| 一区二区三区四区中文字幕| 成人中文字幕在线| 国产精品免费视频网站| 成人高清视频在线| 中文字幕乱码一区二区免费| 国产91精品欧美| 中文字幕国产精品一区二区| 风间由美一区二区av101| 欧美国产精品一区二区| 91网站在线观看视频| 自拍偷拍亚洲欧美日韩| 91免费国产视频网站| 亚洲一区二区三区四区中文字幕| 91一区二区三区在线观看| 一区二区三区在线影院| 欧美在线制服丝袜| 天堂va蜜桃一区二区三区漫画版| 91精品国产麻豆| 国产麻豆视频一区二区| 国产精品欧美久久久久一区二区 | 亚洲乱码一区二区三区在线观看| 色综合中文综合网| 日韩精品一区二区三区视频| 久久99蜜桃精品| 中文字幕不卡在线| 色噜噜狠狠色综合中国| 久久国内精品视频| 中文字幕一区三区| 欧美日韩免费一区二区三区视频| 奇米色一区二区三区四区| 久久综合资源网| 在线视频国内自拍亚洲视频| 日本欧美一区二区三区乱码| 国产精品天美传媒沈樵| 欧美精品777| 懂色av一区二区三区免费看| 亚洲中国最大av网站| 欧美tk丨vk视频| 97成人超碰视| 久久成人羞羞网站| 一区二区三区欧美在线观看| 日韩精品一区二区三区swag| 99久久精品免费看国产 | 精品日韩一区二区| 日本韩国视频一区二区| 久久99在线观看| 亚洲一区二区视频| 欧美激情中文不卡| 欧美成人一区二区三区| 91成人在线观看喷潮| 国产成人精品在线看| 蜜臀a∨国产成人精品| 亚洲黄色小视频| 国产日韩欧美一区二区三区乱码| 欧美日韩国产一级二级| 99久久国产综合精品女不卡| 免费看黄色91| 午夜影视日本亚洲欧洲精品| 亚洲人成网站精品片在线观看 | 精品视频资源站| 成人小视频免费观看| 另类小说一区二区三区| 亚洲第一激情av| 亚洲欧美成人一区二区三区| 久久免费看少妇高潮| 欧美一级午夜免费电影| 欧美日韩mp4| 欧美性感一类影片在线播放| 成人一区二区在线观看| 国内精品在线播放| 日本强好片久久久久久aaa| 无码av免费一区二区三区试看 | 一区2区3区在线看| 国产精品成人一区二区艾草| 久久日韩精品一区二区五区| 91精品欧美久久久久久动漫| 欧美肥大bbwbbw高潮| 欧美日韩中文国产| 7777精品伊人久久久大香线蕉完整版 | 蜜臀av在线播放一区二区三区| 婷婷亚洲久悠悠色悠在线播放 | 国产suv精品一区二区6| 狠狠色狠狠色合久久伊人| 老司机午夜精品| 久久黄色级2电影| 国内一区二区视频| 国产精品正在播放| 国产成人av影院| 成人免费黄色在线| 色综合久久久久久久久| 在线观看欧美精品| 制服丝袜日韩国产| 欧美zozo另类异族| 久久免费电影网| 国产精品久久久久久久久晋中| 国产精品久久久久久福利一牛影视| 久久综合999| 中文字幕在线视频一区| 亚洲精品国久久99热| 亚洲一区视频在线观看视频| 亚洲成年人网站在线观看| 青草国产精品久久久久久| 精品一区二区三区久久| 不卡欧美aaaaa| 欧美日韩一区二区三区在线看| 日韩视频一区二区三区| 国产欧美一区二区三区在线老狼| 国产精品国产自产拍在线| 一区二区三区免费网站| 青青青爽久久午夜综合久久午夜| 狠狠色2019综合网| 99久久国产免费看| 这里只有精品99re| 国产精品情趣视频| 日韩高清在线电影| 成人综合日日夜夜| 欧美欧美欧美欧美首页| 国产女同互慰高潮91漫画| 夜夜精品视频一区二区| 久久精品国产精品亚洲综合| 91小视频免费看| 日韩午夜中文字幕| 一区二区在线观看av| 激情欧美一区二区三区在线观看| 91免费版pro下载短视频| 日韩西西人体444www| 亚洲欧美一区二区不卡| 国产一区二区三区最好精华液| 日本高清免费不卡视频| 精品福利av导航| 亚洲成人动漫在线免费观看| 国产高清一区日本| 欧美一级高清大全免费观看| 中文字幕在线不卡| 国产一区二区美女| 制服丝袜亚洲网站| 亚洲精品国产精品乱码不99| 国产一区二区三区在线看麻豆| 欧美性猛片xxxx免费看久爱| 国产精品毛片久久久久久久| 美女脱光内衣内裤视频久久网站| 99精品视频在线观看免费| 久久精品欧美一区二区三区不卡| 日韩在线a电影| 在线观看日韩毛片| 亚洲欧美偷拍另类a∨色屁股| 国产精品亚洲一区二区三区在线 | 9191成人精品久久| 亚洲欧美另类久久久精品2019| 国产麻豆精品theporn| 在线不卡的av| 午夜精品久久久久久久久久久| 色悠悠久久综合| 国产精品久久久久9999吃药| 国产成人精品免费网站| 国产视频一区二区在线| 精一区二区三区| 日韩欧美国产一区二区三区| 亚洲超丰满肉感bbw| 欧美亚洲国产一区二区三区 | 亚洲欧美在线另类| 成人午夜免费av| 国产精品私房写真福利视频| 国产成人丝袜美腿| 国产欧美一区二区精品久导航 | 亚洲欧洲精品成人久久奇米网| 国产激情一区二区三区桃花岛亚洲| 日韩欧美成人午夜| 久草热8精品视频在线观看| 欧美精品一区二区久久婷婷|