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).
Ïà¹ØÎĵµ£º
¾¯±¨¹ÜÀí
×÷ÒµÖ´ÐÐʱ£¬SQL Server´íÎóÏûÏ¢µÄÐÅÏ¢´æ·ÅÔÚWindowsÊÂÎñÈÕÖ¾ÖС£SQL Server´úÀí¶ÁÈ¡Õâ¸öÈÕÖ¾£¬²¢±È½Ï´æ´¢µÄÏûÏ¢ÓëΪϵͳ¶¨ÒåµÄ¾¯±¨£¬Èç¹ûÆ¥Å䣬SQL Server´úÀí¼¤»î¸Ã¾¯±¨£¬ËùÒÔ£¬¾¯±¨¿ÉÒÔÓÃÓÚÏìӦDZÔÚµÄÎÊÌâ(ÈçÌîÂúÊÂÎñÈÕÖ¾)¡£µ±¾¯±¨±»´¥·¢Ê±£¬Í¨¹ýµç×ÓÓʼþ»òÕßÑ°ºô֪ͨ²Ù×÷Ô±£¬´Ó¶øÈòÙ×÷Ô±Á˽âϵͳÖз¢ÉúÁËʲà ......
SQL ServerÈ«ÎÄË÷ÒýµÄ¸öÈË×ܽá(ÏÂ)-¹ØÓÚÖÐÎÄ·Ö´Ê
(2005-11-14 04:32:01)
תÔØ
·ÖÀࣺÉî¶ÈÑо¿
ÔÚʹÓÃSQL SearchµÄ¹ý³ÌÖУ¬»¹·¢ÏÖÁËÒ»¸öÎÊÌ⣺Ëü¶ÔÖÐÎÄ£¬ÊÇ°´×ִַʵģ¬ÏÂÃæÎÒ½âÊÍһϣº
±ÈÈç¶Ô'²©¿ÍÌóÉÔ±ºÜ¶àÊÇMVP'Õâ¾ä»°£¬¼ÙÈçÒ»¸ö¸öµÄ×ÖµÄ×÷Ë÷Òý£¬»á±ÈʹÓÃ'²©¿ÍÌÃ','³ÉÔ±',MVP'¼¸¸ö´Ê×÷Ë÷ÒýÉú³ÉµÄË ......
ÕâÖÖÓ÷¨ÏàÐÅÔÚÍøÕ¾Öо³£Ê¹Óã¬ÈçÒªÔÚ±íÖÐËæ»úÈ¡³ö10Ìõ¼Ç¼£¬Èç¹ûʹÓñà³ÌÓïÑÔ½øÐÐÔËËãµÄ»°»áºÜÂé·³¶øÇÒЧÂʵÍÏ¡£ÔÚSql ServerÖÐ×Ô´øÁËrandom()º¯ÊýÓÃÓÚÉú³ÉËæ»úÊý£¬ÆäʵËü»¹×Ô´øÁËÁíÍâÒ»¸öËæ»úº¯Êýnewid();newid()ÔÚɨÃèÿÌõ¼Ç¼ʱ¶¼»áÉú³ÉÒ»¸öËæ»úµÄÖµ£º
Ö´ÐÐselect newid()£»ÔËÐнá¹û
¿ÉÒÔ¿´µ½Õâ²¢²»ÊÇÒ»¸öËæ»úµÄÊý× ......
--¾ÛºÏº¯Êý
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) --×îÐ¡Ê ......
--´´½¨±íTongXunLu
CREATE TABLE TongXunLu
(
[tName] nvarchar(30),
[tAddress] nvarchar(50),
[tEmail] varchar(50)
)
--´´½¨±í students
CREATE TABLE students
(
[sId] int IDENTITY (1, 1) primary key NOT NULL ,
[sName] varchar (50) NOT ......