Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

SQLÓï¾ä ´´½¨±í

1.¶¨Òå»ù±¾±íÓï¾ä
    Óï·¨£º
    USE Êý¾Ý¿âÃû CREATE TABLE ±íÃû (ÁÐÃû ÀàÐÍ(´óС) DEFAULT'ĬÈÏÖµ',
                                                         ÁÐÃû ÀàÐÍ(´óС) DEFAULT'ĬÈÏÖµ',  
                                                         ÁÐÃû ÀàÐÍ(´óС) DEFAULT'ĬÈÏÖµ',
                                                         ... ...);
    ×¢£ºÂÌÉ«²¿·ÝÊÇ¿ÉÒÔÊ¡ÂԵġ£
    Àý£ºCREATE TABLE S (SNO char(2), SNAME char(8), AGE decimal(2), SEX char(2) DEFAULT'ÄÐ', DEPT char(2));
          ´´½¨ÁËÒ»¸öÎåÁÐµÄ±í£¬ÆäÖеÚËÄÁеÄĬÈÏֵΪ‘ÄÐ’¡£
--------------------------------------------------------------------------------
2.¶¨ÒåÍêÕûÐÔÔ¼Êø
    Óï·¨£º
    USE Êý¾Ý¿âÃû CREATE TABLE ±íÃû (ÁÐÃû ÀàÐÍ(´óС) DEFAULT'ĬÈÏÖµ' CONSTRAINT Ô¼ÊøÃû Ô¼Êø¶¨Òå,
                                        


Ïà¹ØÎĵµ£º

ͨ¹ý·ÖÎöSQLÓï¾äµÄÖ´Ðмƻ®ÓÅ»¯SQL(Áù)


Ö´Ðмƻ®µÄ²½Öè
Ö´Ðмƻ®µÄÿһ²½·µ»ØÒ»×éÐУ¬ËüÃÇ»òÕßΪÏÂÒ»²½ËùʹÓ㬻òÕßÔÚ×îºóÒ»²½Ê±·µ»Ø¸ø·¢³öSQLÓï¾äµÄÓû§»òÓ¦Óá£ÓÉÿһ²½·µ»ØµÄÒ»×éÐнÐ×öÐÐÔ´(row source£©¡£Í¼5-1Ê÷״ͼÏÔʾÁË´ÓÒ»²½µ½ÁíÒ»²½ÐÐÊý¾ÝµÄÁ÷¶¯Çé¿ö¡£Ã¿²½µÄ±àºÅ·´Ó³ÁËÔÚÄã¹Û²ìÖ´Ðмƻ®Ê±Ëùʾ²½ÖèµÄ˳Ðò£¨ÈçºÎ¹Û²ìÖ´Ðмƻ®½«±»¼ò¶ÌµØ˵Ã÷£©¡£Ò»°ãÀ´ ......

Ê¡ÊÐÖ®Ò» ´´½¨È«¹úÊ¡ÊÐSql±í

×î½üÓÐÅóÓÑÓöµ½Ê¡ÊеÄÎÊÌ⣬ÏëÏë×Ô¼º½ñºóÒ²ÓпÉÄÜ»áÓöµ½£¬ËùÒÔ¾Í×Ô¼ºÔÚÍøÉÏдд£¬ËÑËÑ£¬Ö÷ÒªÊǶÔ×Ô¼º½ñºóÓвο¼
--´´½¨Êý¾Ý¿â
create database NationalAll
Go
--ʹÓÃNationalAllÊý¾Ý¿â
use  NationalAll
Go
--´´½¨Ê¡¼¶±í
Create Table Province
(
ProID int primary key not null,
ProName nvarchar(50) n ......

sql serverÓÅ»¯50·¨

²éѯËÙ¶ÈÂýµÄÔ­ÒòºÜ¶à£¬³£¼ûÈçϼ¸ÖÖ£º
1¡¢Ã»ÓÐË÷Òý»òÕßûÓÐÓõ½Ë÷Òý(ÕâÊDzéѯÂý×î³£¼ûµÄÎÊÌ⣬ÊdzÌÐòÉè¼ÆµÄȱÏÝ)
2¡¢I/OÍÌÍÂÁ¿Ð¡£¬ÐγÉÁËÆ¿¾±Ð§Ó¦¡£
3¡¢Ã»Óд´½¨¼ÆËãÁе¼Ö²éѯ²»ÓÅ»¯¡£
4¡¢ÄÚ´æ²»×ã
5¡¢ÍøÂçËÙ¶ÈÂý
6¡¢²éѯ³öµÄÊý¾ÝÁ¿¹ý´ó£¨¿ÉÒÔ²ÉÓöà´Î²éѯ£¬ÆäËûµÄ·½·¨½µµÍÊý¾ÝÁ¿£©
7¡¢Ëø»òÕßËÀËø(ÕâÒ²ÊDzéѯÂý×î³ ......

sql²Ù×÷´óÈ«

SQL²Ù×÷È«¼¯ 
ÏÂÁÐÓï¾ä²¿·ÖÊÇMssqlÓï¾ä£¬²»¿ÉÒÔÔÚaccessÖÐʹÓᣠ
SQL·ÖÀࣺ 
DDL—Êý¾Ý¶¨ÒåÓïÑÔ(CREATE£¬ALTER£¬DROP£¬DECLARE) 
DML—Êý¾Ý²Ù×ÝÓïÑÔ(SELECT£¬DELETE£¬UPDATE£¬INSERT) 
DCL—Êý¾Ý¿ØÖÆÓïÑÔ(GRANT£¬REVOKE£¬COMMIT£¬ROLLBACK) 
Ê×ÏÈ,¼òÒª½éÉÜ»ù´¡Óï¾ä£º& ......

SQLѧϰʹÓÃ

SQL²Ù×÷È«¼¯
ÏÂÁÐÓï¾ä²¿·ÖÊÇMssqlÓï¾ä£¬²»¿ÉÒÔÔÚaccessÖÐʹÓá£
SQL·ÖÀࣺ
DDL—Êý¾Ý¶¨ÒåÓïÑÔ(CREATE£¬ALTER£¬DROP£¬DECLARE)
DML—Êý¾Ý²Ù×ÝÓïÑÔ(SELECT£¬DELETE£¬UPDATE£¬INSERT)
DCL—Êý¾Ý¿ØÖÆÓïÑÔ(GRANT£¬REVOKE£¬COMMIT£¬ROLLBACK)
Ê×ÏÈ,¼òÒª½éÉÜ»ù´¡Óï¾ä£º
1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
CREATE ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ