锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久久久久国产精品免费无码 ,日本国产精品久久,成人精品一区二区久久久http://www.shnenglu.com/theorix/category/8114.htmltheorixzh-cnWed, 29 Oct 2008 06:48:11 GMTWed, 29 Oct 2008 06:48:11 GMT60SQL 鑰冭瘯鎬葷粨http://www.shnenglu.com/theorix/archive/2008/10/28/65310.html<font color="red">闆鐨勫ぉ絀? theorix )</font><font color="red">闆鐨勫ぉ絀? theorix )</font>Tue, 28 Oct 2008 05:18:00 GMThttp://www.shnenglu.com/theorix/archive/2008/10/28/65310.htmlhttp://www.shnenglu.com/theorix/comments/65310.htmlhttp://www.shnenglu.com/theorix/archive/2008/10/28/65310.html#Feedback0http://www.shnenglu.com/theorix/comments/commentRss/65310.htmlhttp://www.shnenglu.com/theorix/services/trackbacks/65310.html
1.鏁版嵁綾誨瀷錛歜inary image char text datetime smalldatetime decimal 
float real bigint money nchar 


2.USE bookshopdb 
CREATE TABLE Authors 
( AuthorID SMALLINT IDENTITY(101,1) NOT NULL, 
FirstName VARCHAR(30) NOT NULL DEFAULT 'unknown',
LastName VARCHAR(30) NOT NULL, 
YearBorn CHAR(4) NOT NULL DEFAULT ' N/A ', 
YearDied CHAR(4) NOT NULL DEFAULT ' N/A ', 
Description VARCHAR(200) NOT NULL DEFAULT 'N/A' ) 
CREATE TABLE BookAuthors 
( AuthorID SMALLINT NOT NULL, 
TitleID CHAR(8) NOT NULL ) 
CREATE TABLE BookCondition 
( ConditionID TINYINT NOT NULL, 
ConditionName CHAR(10) NOT NULL, 
Description VARCHAR(50) NOT NULL DEFAULT 'N/A' ) 


3.sp_rename錛宻p_changeobjectowner錛孉LTER TABLE 錛?/div>
CREATE TABLE doc_exa ( column_a INT) 
GO 
ALTER TABLE doc_exa ADD column_b VARCHAR(20) NULL 
GO 
EXEC sp_help doc_exa 
GO 
DROP TABLE doc_exa 
GO 
CREATE TABLE cnst_example 
( id INT NOT NULL, 
name VARCHAR(10) NOT NULL, 
salary MONEY NOT NULL 
CONSTRAINT salary_cap CHECK (salary < 100000) )
--- INSERT INTO cnst_example VALUES (2,'Mary Smith',75000) 
--- INSERT INTO cnst_example VALUES (3,'Pat Jones',105000)   
ALTER TABLE cnst_example NOCHECK CONSTRAINT salary_cap 
--- INSERT INTO cnst_example VALUES (3,'Pat Jones',105000) 


4.Private Temporary Tables (#)
Global Temporary Tables (##)

CREATE TABLE #TEMP002(EID INT) GO
INSERT INTO #TEMP002(EID) VALUES (3) GO
SELECT * FROM #TEMP002 GO
DROP TABLE #TEMP002 GO
CREATE TABLE ##TEMP001(EID INT) 
GO



5.CREATE TABLE Table1
( Col1 INT PRIMARY KEY, 
Col2 VARCHAR(30) ) 
CREATE TABLE Table1 
( Col1 INT, 
Col2 VARCHAR(30), 
CONSTRAINT table_pk PRIMARY KEY (Col1) ) 
ALTER TABLE Table1 
ADD CONSTRAINT table_pk PRIMARY KEY (Col1) 

6.UNIQUE Constraints 
If a column (or combination of columns) is not the primary key.  Multiple UNIQUE 

constraints can be defined on a table, whereas only one PRIMARY KEY constraint can be 

defined on a table. 
 If a column allows null values.  UNIQUE constraints can be defined for columns that 

allow null values, whereas PRIMARY KEY constraints can be defined only on columns that 

do not allow null values. 


7.

CREATE TABLE Authors 
( AuthorID SMALLINT IDENTITY(101,1) NOT NULL, 
FirstName VARCHAR(8) NOT NULL DEFAULT 'unknown')


8.
A foreign key is a column or combination of columns used to establish and enforce a 

link between the data in two tables. 

CREATE TABLE Table1 
( Col1 INT PRIMARY KEY, 
Col2 INT REFERENCES Employees(EmployeeID) ) 

CREATE TABLE Table1 
( Col1 INT PRIMARY KEY, 
Col2 INT, 
CONSTRAINT col2_fk FOREIGN KEY (Col2) 
REFERENCES Employees (EmployeeID) ) 
ALTER TABLE Table1 
ADD CONSTRAINT col2_fk FOREIGN KEY (Col2) 
REFERENCES Employees (EmployeeID) 

9.
CHECK Constraints 
CHECK constraints enforce domain integrity by limiting the values that are 

accepted by a column. 

CREATE TABLE Table1 
( Col1 INT PRIMARY KEY, 
Col2 INT CONSTRAINT limit_amount 
CHECK (Col2 BETWEEN 0 AND 1000), 
Col3 VARCHAR(30) ) 

CREATE TABLE Table1 
( Col1 INT PRIMARY KEY, 
Col2 INT, 
Col3 VARCHAR(30), CONSTRAINT limit_amount 
CHECK (Col2 BETWEEN 0 AND 1000) ) 

ALTER TABLE Table1 ADD CONSTRAINT limit_amount 
CHECK (Col2 BETWEEN 0 AND 1000) 

10.
SELECT select_list 
[INTO new_table_name] 
FROM table_list 
[WHERE search_conditions] 
[GROUP BY group_by_list] 
[HAVING search_conditions] 
[ORDER BY order_list [ASC | DESC] ]

The DISTINCT Keyword: eliminates duplicate rows from a result set. 
SELECT DISTINCT ShipCity, ShipRegion 
FROM Orders 
ORDER BY ShipCity 
The TOP n Keyword: specifies that the first n rows of the result set are to be 

returned. 
SELECT DISTINCT TOP 10 ShipCity, ShipRegion 
FROM Orders 
ORDER BY ShipCity 
The AS Keyword: You can improve the readability of a SELECT statement by giving a 

table an alias 
table_name AS table_alias  or table_name table_alias 
SELECT p.pub_id, p.pub_name 
FROM publishers AS p 
Types of Information in the Select List:
SELECT FirstName + ' ' + LastName AS "Employee Name",

IDENTITYCOL AS "Employee ID", HomePhone, Region 
FROM Northwind.dbo.Employees 
ORDER BY LastName, FirstName ASC 
11.
% Any string of zero or more characters.
_ Any single character.
[ ] Any single character within the specified range (for example, [a-f]) or the 

specified set (for example, [abcdef]).
[^] Any single character not within the specified range (for example, [^a-f]) or 

the specified set (for example, [^abcdef]).

SELECT ContactName 
FROM Customers 
WHERE ContactName LIKE 'M[^a]%'

12.
SELECT ContactName 
FROM dbo.Customers 
WHERE ContactName LIKE 'M[^a]%'
UNION ALL
SELECT ContactName 
FROM dbo.Customers 
WHERE ContactName LIKE 'M[a-d]%'

13.
SELECT FirstName, LastName 
INTO EmployeeNames 
FROM Employers

14.
SELECT OrdD1.OrderID AS OrderID, 
SUM(OrdD1.Quantity) AS "Units Sold", 
SUM(OrdD1.UnitPrice * OrdD1.Quantity) AS Revenue

FROM [Order Details] AS OrdD1 
WHERE OrdD1.OrderID in 
(SELECT DISTINCT OrdD2.OrderID 
FROM [Order Details] AS OrdD2 
WHERE OrdD2.UnitPrice > $100) 
GROUP BY OrdD1.OrderID 
HAVING SUM(OrdD1.Quantity) > 100 

15.
USE Pubs 
SELECT Pub_id, Type, Title_id, Price 
FROM Titles 
ORDER BY Pub_id DESC, Type, Price 

16.
Most joins can be categorized as inner joins or outer joins. Inner joins return rows 

only when there is at least one row from both tables that matches the join condition, 

eliminating the rows that do not match with a row from the other table. Outer joins, 

however, return all rows from at least one of the tables or views mentioned in the 

FROM clause as long as these rows meet any WHERE or HAVING search conditions. You can 

also create cross-joins and self-joins. 

17.
SELECT t.Title, p.Pub_name 
FROM Publishers AS p INNER JOIN Titles AS t 
ON p.Pub_id = t.Pub_id 
ORDER BY Title ASC 

18.
SELECT a.Au_fname, a.Au_lname, p.Pub_name 
FROM Authors a LEFT OUTER JOIN Publishers p 
ON a.City = p.City 
ORDER BY p.Pub_name ASC, a.Au_lname ASC, a.Au_fname ASC 

USE Pubs 
SELECT a.Au_fname, a.Au_lname, p.Pub_name 
FROM Authors a RIGHT OUTER JOIN Publishers p 
ON a.City = p.City 
ORDER BY p.Pub_name ASC, a.Au_lname ASC, a.Au_fname ASC 

USE Pubs 
SELECT a.Au_fname, a.Au_lname, p.Pub_name 
FROM Authors a FULL OUTER JOIN Publishers p 
ON a.City = p.City 
ORDER BY p.Pub_name ASC, a.Au_lname ASC, a.Au_fname ASC

USE Northwind 
SELECT ProductName 
FROM Products 
WHERE UnitPrice = ( 
SELECT UnitPrice 
FROM Products 
WHERE ProductName = 'Sir Rodney''s Scones' ) 

WHERE <expression> [NOT] IN (<subquery>) 
WHERE <expression> <comparison_operator> [ANY | ALL] (<subquery>) 
WHERE [NOT] EXISTS (<subquery>) 

USE Pubs 
SELECT Pub_name 
FROM Publishers 
WHERE Pub_id IN ( SELECT Pub_id FROM Titles WHERE Type = 'business'  )


USE Pubs 
SELECT Title 
FROM Titles WHERE Advance > ANY ( 
SELECT Advance 
FROM Publishers INNER JOIN Titles ON Titles.Pub_id = Publishers.Pub_id AND Pub_name = 

'Algodata Infosystems' )

USE Pubs 
SELECT Pub_name 
FROM Publishers 
WHERE EXISTS ( 
SELECT * 
FROM Titles 
WHERE Titles.Pub_id = Publishers.Pub_id AND 
Type = 'business' ) 

AVG(expression)
COUNT(expression)
COUNT(*)
MAX(expression)
MIN(expression)
SUM(expression)


19.
Using the CUBE Operator to Summarize Data 
The CUBE operator generates a result set that is a multi-dimensional cube. A 

multi-dimensional cube is an expansion of fact data, or data that records individual 

events. The expansion is based on columns that the user wants to analyze. These 

columns are called dimensions. The cube is a result set containing a cross-tabulation 

of all the possible combinations of the dimensions. 
The following SELECT statement uses the CUBE operator in the GROUP BY clause: 
USE Pubs 
SELECT SUBSTRING(Title, 1, 65) AS Title, SUM(qty) AS 'Quantity' 
FROM Sales INNER JOIN Titles 
ON Sales.Title_id = Titles.Title_id 
GROUP BY Title WITH CUBE 
ORDER BY Title 

20.

USE Pubs 
INSERT INTO NewBooks (BookTitle, BookType) 
SELECT Title, Type 
FROM Titles WHERE Type = 'mod_cook' 

CREATE DEFAULT bound_default AS 'Bound default value' 
GO 
CREATE TABLE T1 ( column_1 int identity, 
column_2 varchar(30) 
CONSTRAINT default_name DEFAULT ('column default'), column_3 

timestamp, 
column_4 varchar(30), 
column_5 int NULL) 
GO 
USE master 
EXEC sp_bindefault 'bound_default','T1.column_4' 
INSERT INTO T1 DEFAULT VALUES 
--   SELECT * FROM T1 

21.
UPDATE        
table_name or view_name      
SET        
column_name = { expression | DEFAULT | NULL }
FROM table_source        
WHERE search_condition 

USE Pubs 
UPDATE NewBooks 
SET Price = Price * 1.1 

USE Pubs 
UPDATE NewBooks 
SET Price = Titles.Price 
FROM NewBooks JOIN Titles 
ON NewBooks.BookTitle = Titles.Title 

USE Pubs 
UPDATE NewBooks 
SET BookType = 'popular' 
WHERE BookType = 'popular_comp‘

DELETE table_or_view 
FROM table_source 
WHERE search_condition 
Example:
USE Pubs 
DELETE NewBooks 
FROM Titles 
WHERE NewBooks.BookTitle = Titles.Title AND Titles.Royalty = 10 




闆鐨勫ぉ絀? theorix ) 2008-10-28 13:18 鍙戣〃璇勮
]]>
姊ㄨ姳棣?(姝岃瘝)http://www.shnenglu.com/theorix/archive/2008/09/01/60556.html<font color="red">闆鐨勫ぉ絀? theorix )</font><font color="red">闆鐨勫ぉ絀? theorix )</font>Sun, 31 Aug 2008 18:23:00 GMThttp://www.shnenglu.com/theorix/archive/2008/09/01/60556.htmlhttp://www.shnenglu.com/theorix/comments/60556.htmlhttp://www.shnenglu.com/theorix/archive/2008/09/01/60556.html#Feedback0http://www.shnenglu.com/theorix/comments/commentRss/60556.htmlhttp://www.shnenglu.com/theorix/services/trackbacks/60556.html姊ㄨ姳棣欐瓕璇?/span>

絎戠湅涓栭棿 鐥翠漢涓囧崈

鐧介鍚屽?瀹為毦寰楄

浜洪潰妗冭姳鏄皝鍦ㄦ壆婕?/font>

浜嬭繃澧冭縼 鏁呬漢闅捐

鏃ф棩榛勬槒 鏄犵収鏂伴

鐩告濅箣鑻﹁皝鍙堟暍鐩磋█

姊ㄨ姳棣?鍗磋浜哄績鎰熶激

鎰佹柇鑲?鍗冩澂閰掕В鎬濋噺

鑾浉鏈?鏃ф椂浜烘柊妯℃牱 鎬濆繕涔?/font>

浜嬭繃澧冭縼 鏁呬漢闅捐

鏃ф棩榛勬槒 鏄犵収鏂伴

鐩告濅箣鑻﹁皝鍙堟暍涔嬭█

涓烘儏浼?涓栭棿浜嬬殕鏃犲父

絎戞缽妗?涓囪娉寲瀵掔獥

鍕垮椒寰?鑴辯礌瑁圭潃鏄ヨ 蹇嗘祦鑺?/font>

絎戞垜澶繃鐥寸媯

鐩告濆鏈ぎ

鐙垜瀛よ姵鑷祻 孌嬮

姊ㄨ姳棣?鍗磋浜哄績鎰熶激

鎰佹柇鑲?鍗冩澂閰掕В鎬濋噺

鑾浉鏈?鏃ф椂浜烘柊妯℃牱 鎬濇湜涔?/font>

涓烘儏浼?涓栭棿浜嬬殕鏃犲父

絎戞缽妗?涓囪娉寲瀵掔獥

鍕垮椒寰?鑴辯礌瑁圭潃鏄ヨ 蹇嗘祦鑺?/font>

絎戞垜澶繃鐥寸媯



]]>
MY LOVE WILL GET YOU HOME http://www.shnenglu.com/theorix/archive/2008/08/31/60473.html<font color="red">闆鐨勫ぉ絀? theorix )</font><font color="red">闆鐨勫ぉ絀? theorix )</font>Sat, 30 Aug 2008 16:46:00 GMThttp://www.shnenglu.com/theorix/archive/2008/08/31/60473.htmlhttp://www.shnenglu.com/theorix/comments/60473.htmlhttp://www.shnenglu.com/theorix/archive/2008/08/31/60473.html#Feedback0http://www.shnenglu.com/theorix/comments/commentRss/60473.htmlhttp://www.shnenglu.com/theorix/services/trackbacks/60473.html闃呰鍏ㄦ枃

闆鐨勫ぉ絀? theorix ) 2008-08-31 00:46 鍙戣〃璇勮
]]>
伊人久久一区二区三区无码| 亚洲va久久久噜噜噜久久狠狠| 国产成人精品久久免费动漫| 久久99精品国产一区二区三区| 亚洲国产精久久久久久久| 理论片午午伦夜理片久久 | 久久超乳爆乳中文字幕| 亚洲国产成人久久精品动漫| 久久久国产精华液| 久久久久久久综合日本亚洲| 97精品依人久久久大香线蕉97| www性久久久com| 久久久久波多野结衣高潮| 国产日韩久久免费影院| 久久久亚洲欧洲日产国码二区| 色悠久久久久久久综合网| 久久er热视频在这里精品| 久久久久久免费视频| 精品免费久久久久国产一区| 久久丫精品国产亚洲av| 一级做a爰片久久毛片免费陪| 91久久九九无码成人网站 | 国内精品久久久久国产盗摄| 久久棈精品久久久久久噜噜| 精品伊人久久久| 久久免费视频一区| 精品乱码久久久久久夜夜嗨| 国产精品久久久久天天影视| 久久久噜噜噜久久熟女AA片| 久久丫精品国产亚洲av不卡 | 尹人香蕉久久99天天拍| 欧美午夜A∨大片久久| 久久精品一区二区国产| 久久精品国产半推半就| 国产成人久久激情91| 狠狠色丁香久久婷婷综合五月 | 欧美色综合久久久久久| 欧美精品福利视频一区二区三区久久久精品 | 国产AV影片久久久久久| 伊人久久精品线影院| 久久综合狠狠综合久久激情 |