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

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

?? ch08.htm

?? 21精通SQL
?? HTM
?? 第 1 頁 / 共 4 頁
字號:


</BLOCKQUOTE>

<P>Some database systems provide an extension to the standard <TT>UPDATE</TT> syntax.
SQL Server's Transact-SQL language, for instance, enables programmers to update the
contents of a table based on the contents of several other tables by using a <TT>FROM</TT>
clause. The extended syntax looks like this:</P>
<H5>SYNTAX:</H5>
<PRE><FONT COLOR="#0066FF">UPDATE table_name
SET columnname1 = value1
[, columname2 = value2]...
FROM table_list
WHERE search_condition
</FONT></PRE>
<H4><FONT COLOR="#000077">Example 8.6</FONT></H4>
<P>Here's an example of the extension:</P>
<H5>INPUT:</H5>
<PRE><FONT COLOR="#0066FF">SQL&gt; <B>UPDATE COLLECTION</B>
  2  <B>SET WORTH = WORTH * 0.005;</B>
</FONT></PRE>
<P>that changes the table to this:</P>
<H5>INPUT/OUTPUT:</H5>
<PRE><FONT COLOR="#0066FF">SQL&gt;<B> SELECT * FROM COLLECTION;</B>

ITEM                     WORTH REMARKS
-------------------- -------- ----------------------------
NBA ALL STAR CARDS       2.775 SOME STILL IN BIKE SPOKES
MALIBU BARBIE            2.775 TAN NEEDS WORK
STAR WARS GLASS          2.775 HANDLE CHIPPED
LOCK OF SPOUSES HAIR     2.775 HASN'T NOTICED BALD SPOT YET
SUPERMANS CAPE           2.775 TUGGED ON IT
STRING                   2.775 SOME DAY IT WILL BE VALUABLE

6 rows selected.
</FONT></PRE>
<H5>ANALYSIS:</H5>
<P>This syntax is useful when the contents of one table need to be updated following
the manipulation of the contents of several other tables. Keep in mind that this
syntax is nonstandard and that you need to consult the documentation for your particular
database management system before you use it.</P>
<P>The <TT>UPDATE</TT> statement can also update columns based on the result of an
arithmetic expression. When using this technique, remember the requirement that the
data type of the result of the expression must be the same as the data type of the
field that is being modified. Also, the size of the value must fit within the size
of the field that is being modified.</P>
<P>Two problems can result from the use of calculated values: truncation and overflow.<I>
Truncation </I>results when the database system converts a fractional number to an
integer, for instance. <I>Overflow </I>results when the resulting value is larger
than the capacity of the modified column, which will cause an error to be returned
by your database system.


<BLOCKQUOTE>
	<P>
<HR>
<FONT COLOR="#000077"><B>NOTE:</B></FONT><B> </B>Some database systems handle the
	overflow problem for you. Oracle7 converts the number to exponential notation and
	presents the number that way. You should keep this potential error in mind when using
	number data types. 
<HR>
</P>
	<P>
<HR>
<FONT COLOR="#000077"><B>TIP:</B></FONT><B> </B>If you update a column(s) and notice
	an error after you run the update, issue the <TT>ROLLBACK</TT> command (as you would
	for an incorrect insert) to void the update. See Day 11 for more on the <TT>ROLLBACK</TT>
	command. 
<HR>


</BLOCKQUOTE>

<H2><FONT COLOR="#000077">The DELETE Statement</FONT></H2>
<P>In addition to adding data to a database, you will also need to delete data from
a database. The syntax for the <TT>DELETE</TT> statement is</P>
<H5>SYNTAX:</H5>
<PRE><FONT COLOR="#0066FF">DELETE FROM tablename
WHERE condition
</FONT></PRE>
<P>The first thing you will probably notice about the <TT>DELETE</TT> command is
that it doesn't have a prompt. Users are accustomed to being prompted for assurance
when, for instance, a directory or file is deleted at the operating system level.
<TT>Are you sure? (Y/N)</TT> is a common question asked before the operation is performed.
Using SQL, when you instruct the DBMS to delete a group of records from a table,
it obeys your command without asking. That is, when you tell SQL to delete a group
of records, it will really do it!</P>
<P>On Day 11 you will learn about transaction control. Transactions are database
operations that enable programmers to either <TT>COMMIT</TT> or <TT>ROLLBACK</TT>
changes to the database. These operations are very useful in online transaction-processing
applications in which you want to execute a batch of modifications to the database
in one logical execution. Data integrity problems will occur if operations are performed
while other users are modifying the data at the same time. For now, assume that no
transactions are being undertaken.


<BLOCKQUOTE>
	<P>
<HR>
<FONT COLOR="#000077"><B>NOTE:</B></FONT><B> </B>Some implementations, for example,
	Oracle, automatically issue a <TT>COMMIT</TT> command when you exit SQL. 
<HR>


</BLOCKQUOTE>

<P>Depending on the use of the <TT>DELETE</TT> statement's <TT>WHERE</TT> clause,
SQL can do the following:

<UL>
	<LI>Delete single rows
	<P>
	<LI>Delete multiple rows
	<P>
	<LI>Delete all rows
	<P>
	<LI>Delete no rows
</UL>

<P>Here are several points to remember when using the <TT>DELETE</TT> statement:

<UL>
	<LI>The <TT>DELETE</TT> statement cannot delete an individual field's values (use
	<TT>UPDATE</TT> instead). The <TT>DELETE</TT> statement deletes entire records from
	a single table.
	<P>
	<LI>Like <TT>INSERT</TT> and <TT>UPDATE</TT>, deleting records from one table can
	cause referential integrity problems within other tables. Keep this potential problem
	area in mind when modifying data within a database.
	<P>
	<LI>Using the <TT>DELETE</TT> statement deletes only records, not the table itself.
	Use the <TT>DROP TABLE</TT> statement (see Day 9) to remove an entire table.
</UL>

<H4><FONT COLOR="#000077">Example 8.7</FONT></H4>
<P>This example shows you how to delete all the records from <TT>COLLECTION</TT>
where <TT>WORTH</TT> is less than <TT>275</TT>.</P>
<H5>INPUT:</H5>
<PRE><FONT COLOR="#0066FF">SQL&gt; <B>DELETE FROM COLLECTION</B>
  2  <B>WHERE WORTH &lt; 275;
</B>
4 rows deleted.
</FONT></PRE>
<P>The result is a table that looks like this:</P>
<H5>INPUT/OUTPUT:</H5>
<PRE><FONT COLOR="#0066FF">SQL&gt; <B>SELECT * FROM COLLECTION;</B>

ITEM                     WORTH REMARKS
-------------------- --------- ------------------------------
NBA ALL STAR CARDS         300 SOME STILL IN BIKE SPOKES

STRING                    1000 SOME DAY IT WILL BE VALUABLE
</FONT></PRE>


<BLOCKQUOTE>
	<P>
<HR>
<FONT COLOR="#000077"><B>WARNING:</B></FONT><B> </B>Like the <TT>UPDATE </TT>statement,
	if you omit a <TT>WHERE</TT> clause from the <TT>DELETE</TT> statement, all rows
	in that particular table will be deleted. 
<HR>


</BLOCKQUOTE>

<P>Example 8.8 uses all three data manipulation statements to perform a set of database
operations.
<H4><FONT COLOR="#000077">Example 8.8</FONT></H4>
<P>This example inserts some new rows into the <TT>COLLECTION</TT> table you used
earlier today.</P>
<H5>INPUT:</H5>
<PRE><FONT COLOR="#0066FF">SQL&gt; <B>INSERT INTO COLLECTION</B>
  2  <B>VALUES('CHIA PET', 5,'WEDDING GIFT');</B></FONT></PRE>
<H5><FONT COLOR="#000000">OUTPUT:</FONT></H5>
<PRE><FONT COLOR="#0066FF">1 row created.</FONT></PRE>
<H5><FONT COLOR="#000000">INPUT:</FONT></H5>
<PRE><FONT COLOR="#0066FF">SQL&gt; <B>INSERT INTO COLLECTION</B>
  2 <B> VALUES('TRS MODEL III', 50, 'FIRST COMPUTER');</B></FONT></PRE>
<H5><FONT COLOR="#000000">OUTPUT:</FONT></H5>
<PRE><FONT COLOR="#0066FF">1 row created.
</FONT></PRE>
<P>Now create a new table and copy this data to it:</P>
<H5>INPUT/OUTPUT:</H5>
<PRE><FONT COLOR="#0066FF">SQL&gt;<B> CREATE TABLE TEMP</B>
  2 <B> (NAME CHAR(20),</B>
  3  <B>VALUE NUMBER,</B>
  4  <B>REMARKS CHAR(40));</B>

Table created.</FONT></PRE>
<H5><FONT COLOR="#000000">INPUT/OUTPUT:</FONT></H5>
<PRE><FONT COLOR="#0066FF">SQL&gt; <B>INSERT INTO TEMP(NAME, VALUE, REMARKS)</B>
  2  <B>SELECT ITEM, WORTH, REMARKS</B>
  3 <B> FROM COLLECTION;</B>

4 rows created.</FONT></PRE>
<H5><FONT COLOR="#000000">INPUT/OUTPUT:</FONT></H5>
<PRE><FONT COLOR="#0066FF">SQL&gt; <B>SELECT * FROM TEMP;</B>

NAME                     VALUE REMARKS
-------------------- --------- ------------------------------
NBA ALL STAR CARDS         300 SOME STILL IN BIKE SPOKES
STRING                    1000 SOME DAY IT WILL BE VALUABLE
CHIA PET                     5 WEDDING GIFT
TRS MODEL III               50 FIRST COMPUTER
</FONT></PRE>
<P>Now change some values:</P>
<H5>INPUT/OUTPUT:</H5>
<PRE><FONT COLOR="#0066FF">SQL&gt; <B>UPDATE TEMP</B>
  2  <B>SET VALUE = 100</B>
  3  <B>WHERE NAME = 'TRS MODEL III';</B>

1 row updated.</FONT></PRE>
<H5><FONT COLOR="#000000">INPUT/OUTPUT:</FONT></H5>
<PRE><FONT COLOR="#000000"></FONT></PRE>
<PRE><FONT COLOR="#0066FF">SQL&gt; <B>UPDATE TEMP</B>
  2  <B>SET VALUE = 8</B>
  3  <B>WHERE NAME = 'CHIA PET';</B>

1 row updated.</FONT></PRE>
<H5><FONT COLOR="#000000">INPUT/OUTPUT:</FONT></H5>
<PRE><FONT COLOR="#0066FF">SQL&gt; <B>SELECT * FROM TEMP;</B>

NAME                     VALUE REMARKS
-------------------- --------- ----------------------------
NBA ALL STAR CARDS         300 SOME STILL IN BIKE SPOKES
STRING                    1000 SOME DAY IT WILL BE VALUABLE
CHIA PET                     8 WEDDING GIFT
TRS MODEL III              100 FIRST COMPUTER
</FONT></PRE>
<P>And update these values back to the original table:</P>
<H5>INPUT:</H5>
<PRE><FONT COLOR="#0066FF">INSERT COLLECTION
SELECT * FROM TEMP;
DROP TABLE TEMP;
</FONT></PRE>
<H5>ANALYSIS:</H5>
<P>The <TT>DROP TABLE</TT> and <TT>CREATE TABLE</TT> statements are discussed in
greater detail on Day 9. For now, these statements basically do what their names
suggest. <TT>CREATE TABLE</TT> builds a new table with the format you give it, and
<TT>DROP TABLE</TT> deletes the table. Keep in mind that <TT>DROP TABLE</TT> permanently
removes a table, whereas <TT>DELETE FROM &lt;TableName&gt;</TT> removes only the
records from a table.</P>
<P>To check what you have done, select out the records from the <TT>COLLECTION</TT>
table. You will see that the changes you made now exist in the <TT>COLLECTION</TT>
table.</P>
<H5>INPUT/OUTPUT:</H5>
<PRE><FONT COLOR="#0066FF">SQL&gt; <B>SELECT * FROM COLLECTION;</B>
</FONT></PRE>
<PRE><FONT COLOR="#0066FF">NAME                     VALUE REMARKS
-------------------- -------- ----------------------------
NBA ALL STAR CARDS         300 SOME STILL IN BIKE SPOKES
STRING                    1000 SOME DAY IT WILL BE VALUABLE
CHIA PET                     8 WEDDING GIFT
TRS MODEL III              100 FIRST COMPUTER
</FONT></PRE>
<H5>ANALYSIS:</H5>
<P>The previous example used all three data manipulation commands--<TT>INSERT</TT>,
<TT>UPDATE</TT>, and <TT>DELETE</TT>--to perform a set of operations on a table.
The <TT>DELETE</TT> statement is the easiest of the three to use.


<BLOCKQUOTE>
	<P>
<HR>
<FONT COLOR="#000077"><B>WARNING:</B></FONT><B> </B>Always keep in mind that any
	modifications can affect the referential integrity of your database. Think through
	all your database editing steps to make sure that you have updated all tables correctly.
	
<HR>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美中文字幕一二三区视频| 久久久精品天堂| 欧美电视剧在线看免费| 一区在线观看视频| 日韩国产成人精品| 粉嫩嫩av羞羞动漫久久久 | 亚洲乱码国产乱码精品精小说 | 亚洲中国最大av网站| 国产激情视频一区二区在线观看| 欧美视频在线播放| 中文字幕乱码一区二区免费| 男女激情视频一区| 欧美日韩国产三级| 亚洲欧美日韩国产一区二区三区 | 肉肉av福利一精品导航| 一本色道久久综合狠狠躁的推荐| 久久精品网站免费观看| 日本成人中文字幕在线视频| 欧美亚洲综合久久| 亚洲愉拍自拍另类高清精品| 91偷拍与自偷拍精品| 国产精品视频yy9299一区| 久久成人久久鬼色| 精品少妇一区二区三区在线视频| 亚洲成人在线观看视频| 欧美三区在线观看| 亚洲福利电影网| 欧洲一区在线电影| 亚洲成人动漫在线观看| 欧美日精品一区视频| 樱花草国产18久久久久| 91福利精品视频| 一区二区三区四区在线播放| 91视视频在线观看入口直接观看www| 亚洲国产精品v| k8久久久一区二区三区| 亚洲三级电影网站| 色美美综合视频| 亚洲一区在线看| 51久久夜色精品国产麻豆| 五月综合激情网| 日韩久久免费av| 国产一区二区三区精品欧美日韩一区二区三区 | 蜜桃av一区二区在线观看| 欧美一区二视频| 精品综合久久久久久8888| 欧美成人精品3d动漫h| 极品美女销魂一区二区三区| 国产欧美一区二区三区沐欲| www.亚洲人| 亚洲动漫第一页| 精品国产免费视频| 不卡在线观看av| 亚洲午夜日本在线观看| 日韩欧美中文一区二区| 国产成人综合在线| 亚洲免费av在线| 欧美一区二区久久| 成人开心网精品视频| 亚洲一区二区三区三| 26uuu另类欧美| 91丨九色丨尤物| 蜜臀av性久久久久av蜜臀妖精| 久久综合狠狠综合久久综合88| 91视频com| 蜜臀久久99精品久久久久宅男| 国产人久久人人人人爽| 欧美中文字幕一区二区三区| 精品一区二区三区免费| 日韩久久一区二区| 精品播放一区二区| 在线免费观看不卡av| 激情综合色播五月| 亚洲一区在线观看视频| 日本一区二区三区高清不卡| 欧美偷拍一区二区| 成人午夜视频网站| 奇米一区二区三区av| 综合激情网...| 2021久久国产精品不只是精品| 在线观看视频欧美| 成人av小说网| 精品一区二区三区香蕉蜜桃| 亚洲国产精品一区二区www| 久久久激情视频| 日韩欧美一卡二卡| 欧美日韩在线三级| 国产在线精品一区二区| 亚洲午夜久久久久久久久电影网| 日韩亚洲国产中文字幕欧美| 91麻豆swag| 国产一区二区三区在线观看免费| 爽好多水快深点欧美视频| 中文字幕一区日韩精品欧美| 精品国产精品网麻豆系列| 欧美日韩五月天| 91麻豆国产在线观看| 东方aⅴ免费观看久久av| 免费人成黄页网站在线一区二区 | 日本精品一级二级| www.视频一区| 粉嫩av一区二区三区粉嫩| 看电影不卡的网站| 日韩不卡手机在线v区| 亚洲午夜日本在线观看| 一卡二卡三卡日韩欧美| 亚洲人123区| 日韩一区有码在线| 国产精品欧美一区喷水| 久久精品亚洲麻豆av一区二区 | 欧美日韩二区三区| 欧美午夜精品久久久久久超碰 | 粉嫩av一区二区三区在线播放| 国内精品久久久久影院一蜜桃| 日韩中文字幕av电影| 亚洲18影院在线观看| 日韩精品视频网| 另类综合日韩欧美亚洲| 国内精品伊人久久久久av影院 | 日韩av一区二| 日本成人超碰在线观看| 久久精品国产亚洲a| 狠狠狠色丁香婷婷综合久久五月| 免费人成在线不卡| 国产米奇在线777精品观看| 国产一区二区三区久久久| 国产99久久久精品| 成人毛片在线观看| 91高清视频在线| 91麻豆精品久久久久蜜臀| 日韩一区二区三区在线观看| 久久综合给合久久狠狠狠97色69| 久久尤物电影视频在线观看| 久久久久99精品一区| 综合久久国产九一剧情麻豆| 亚洲成人黄色小说| 韩国精品一区二区| 99riav久久精品riav| 91豆麻精品91久久久久久| 欧美日本韩国一区| 久久综合视频网| 一区二区三区在线高清| 奇米影视一区二区三区| 成人aa视频在线观看| 欧美日韩国产成人在线91| 2022国产精品视频| 中文天堂在线一区| 亚洲综合男人的天堂| 极品少妇xxxx精品少妇偷拍| 99久久精品免费看国产| 欧美日韩免费电影| 国产无一区二区| 亚洲一级在线观看| 国产精品资源在线| 欧美三级电影在线看| 国产欧美日韩卡一| 午夜欧美2019年伦理| 成人中文字幕合集| 777午夜精品免费视频| 国产精品久久久久久久久晋中 | 欧美一区二区三区免费在线看 | 久久蜜臀精品av| 亚洲国产精品人人做人人爽| 国产成人在线电影| 欧美另类久久久品| 中文字幕一区二区5566日韩| 麻豆一区二区三| 欧美亚一区二区| 日本一区二区动态图| 日本不卡高清视频| 色94色欧美sute亚洲线路二 | 91精品国产麻豆国产自产在线 | 国产人成一区二区三区影院| 午夜电影网一区| 色婷婷精品久久二区二区蜜臂av| 久久久欧美精品sm网站| 亚洲123区在线观看| 91在线porny国产在线看| 久久久www成人免费无遮挡大片 | 亚洲国产一区二区三区| 国产91精品免费| 欧美成人精品3d动漫h| 偷拍日韩校园综合在线| 色丁香久综合在线久综合在线观看| 国产亚洲一区二区三区四区| 免费一区二区视频| 91精品国产色综合久久ai换脸| 一区二区三区av电影| jlzzjlzz欧美大全| 国产精品二区一区二区aⅴ污介绍| 国产一区二区中文字幕| 欧美xfplay| 久久精品国产99久久6| 欧美成人午夜电影| 久久99国产精品成人| 日韩欧美一区二区免费| 蜜桃视频一区二区| 精品久久国产97色综合| 狠狠狠色丁香婷婷综合久久五月| 欧美成人性福生活免费看|