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

What Is SQL?

What Is SQL?
SQL (pronounced as the letters S-Q-L or as sequel) is an abbreviation for Structured Query Language. SQL is a language designed specifically for communicating with databases.
Unlike other languages (spoken languages like English, or programming languages like Java or Visual Basic), SQL is made up of very few words. This is deliberate. SQL is designed to do one thing and do it well—provide you with a simple and efficient way to read and write data from a database.
What are the advantages of SQL?
SQL is not a proprietary language used by specific database vendors. Almost every major DBMS supports SQL, so learning this one language will enable you to interact with just about every database you'll run into.
SQL is easy to learn. The statements are all made up of descriptive English words, and there aren't that many of them.
Despite its apparent simplicity, SQL is actually a very powerful language, and by cleverly using its language elements you can perform very complex and sophisticated database operations.
And with that, let's learn SQL.
 
SQL Extensions : Many DBMS vendors have extended their support for SQL by adding statements or instructions to the language. The purpose of these extensions is to provide additional functionality or simplified ways to perform specific operations. And while often extremely useful, these extensions tend to be very DBMS specific, and they are rarely supported by more than a single vendor.
Standard SQL is governed by the ANSI standards committee, and is thus called ANSI SQL. All major DBMSs, even those with their own extensions, support ANSI SQL. Individual implementations have their own names (PL-SQL, Transact-SQL, and so forth).


Ïà¹ØÎĵµ£º

asp.netµÄsql·À×¢Èë


/// <summary>
    /// ¹ýÂ˱ê¼Ç
    /// </summary>
    /// <param name="NoHTML">°üÀ¨HTML£¬½Å±¾£¬Êý¾Ý¿â¹Ø¼ü×Ö£¬ÌØÊâ×Ö·ûµÄÔ´Âë </param>
    /// <returns>ÒѾ­È¥³ý±ê¼ÇºóµÄÎÄ×Ö</returns>
  &nbs ......

sql server 2000Ð¶ÔØºó£¬Ôٴΰ²×°µÄÎÊÌâ

´íÎóÌáʾ£¬ÓÐÒ»¸öÎļþÒѾ­¹ÒÆð£¬±ØÐëÖØÐÂÆô¶¯¼ÆËã»ú¡£ÖØÐÂÆô¶¯£¬Ôٴΰ²×°ÈÔÈ»ÊÇͬÑùµÄÎÊÌâ¡£
×¢²á±í¼üÖµµÄÎÊÌâ¡£½â¾ö·½·¨£º
ֻҪɾ³ý\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\ϵÄPendingFileRenameOperations¼üÖµ£¬¾Í¿ÉÒÔÖØÐ°²×°ÁË¡£
ɾ³ýºó°²×°£¬²»±ØÖØÐÂÆô¶¯¼ÆËã»ú¡£ ......

Sqlº¯Êý´óÈ«

---·µ»Ø±í´ïʽÖÐÖ¸¶¨×Ö·ûµÄ¿ªÊ¼Î»ÖÃ
select charindex('c','abcdefg',1)
---Á½¸ö×Ö·ûµÄÖµÖ®²î
select difference('bet','bit')
---×Ö·û×î×ó²àÖ¸¶¨ÊýÄ¿
select left('abcdef',3)
---·µ»Ø×Ö·ûÊý
select len('abcdefg')
--ת»»ÎªÐ¡×Ö·û
select lower('ABCDEFG')
--È¥×ó¿Õ¸ñºó
select ltrim('   &nbs ......

SQL³£¼û²éѯÎÊÌâ(±à³Ì)


ÓÐЩ³£¼ûµÄÎÊÌâÔÚÂÛ̳Öв»¶Ï³öÏÖ£¬²»·ÁÕûÀíһϡ£
ÒÔÏÂÓï¾äÊÇÔÚSQLServer2005ÉÏʵÏֵģ¬Ò»Ð©Óï¾äÎÞ·¨ÔÚSS2000ÉÏÖ´ÐС£
ÓÐÓÃÖ¸ÊýÊÇÎÒ¸ù¾ÝÕâ¸öÎÊÌâµÄ³£¼û³Ì¶È´òµÄ·Ö£¬½ö¹©²Î¿¼¡£Êµ¼ÊÉÏ£¬µ±ÄãÓöµ½ÁËÕâ¸öÎÊÌ⣬Õâ¸öÎÊÌâÄÄÅÂÔÙÉÙ¼û£¬½â¾ö·½°¸Ò²ÊǷdz£ÓÐÓõġ£
1. Éú³ÉÈô¸ÉÐмǼ
ÓÐÓÃÖ¸Êý£º¡ï¡ï¡ï¡ï¡ï
³£¼ûµÄÎÊÌâÀàÐÍ£º¸ù ......

SQL Serverº¯Êý´óÈ«

--¾ÛºÏº¯Êý
use pubs
go
select avg(distinct price)  --ËãÆ½¾ùÊý
from titles
where type='business'
go 
use pubs
go
select max(ytd_sales)  --×î´óÊý
from titles
go 
use pubs
go
select min(ytd_sales) --×îÐ¡Ê ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ