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

sqlÓï¾ä¶à±í²éѯ

ÎÊÌâ¼°ÃèÊö£º
--1.ѧÉú±í
Student(S#,Sname,Sage,Ssex) --S# ѧÉú±àºÅ,Sname ѧÉúÐÕÃû,Sage ³öÉúÄêÔÂ,Ssex ѧÉúÐÔ±ð
--2.¿Î³Ì±í
Course(C#,Cname,T#) --C# --¿Î³Ì±àºÅ,Cname ¿Î³ÌÃû³Æ,T# ½Ìʦ±àºÅ
--3.½Ìʦ±í
Teacher(T#,Tname) --T# ½Ìʦ±àºÅ,Tname ½ÌʦÐÕÃû
--4.³É¼¨±í
SC(S#,C#,score) --S# ѧÉú±àºÅ,C# ¿Î³Ì±àºÅ,score ·ÖÊý
*/
--´´½¨²âÊÔÊý¾Ý
create table Student(S# varchar(10),Sname nvarchar(10),Sage datetime,Ssex nvarchar(10))
insert into Student values('01' , N'ÕÔÀ×' , '1990-01-01' , N'ÄÐ')
insert into Student values('02' , N'Ç®µç' , '1990-12-21' , N'ÄÐ')
insert into Student values('03' , N'Ëï·ç' , '1990-05-20' , N'ÄÐ')
insert into Student values('04' , N'ÀîÔÆ' , '1990-08-06' , N'ÄÐ')
insert into Student values('05' , N'ÖÜ÷' , '1991-12-01' , N'Å®')
insert into Student values('06' , N'ÎâÀ¼' , '1992-03-01' , N'Å®')
insert into Student values('07' , N'Ö£Öñ' , '1989-07-01' , N'Å®')
insert into Student values('08' , N'Íõ¾Õ' , '1990-01-20' , N'Å®')
create table Course(C# varchar(10),Cname nvarchar(10),T# varchar(10))
insert into Course values('01' , N'ÓïÎÄ' , '02')
insert into Course values('02' , N'Êýѧ' , '01')
insert into Course values('03' , N'Ó¢Óï' , '03')
create table Teacher(T# varchar(10),Tname nvarchar(10))
insert into Teacher values('01' , N'ÕÅÈý')
insert into Teacher values('02' , N'ÀîËÄ')
insert into Teacher values('03' , N'ÍõÎå')
create table SC(S# varchar(10),C# varchar(10),score decimal(18,1))
insert into SC values('01' , '01' , 80)
insert into SC values('01' , '02' , 90)
insert into SC values('01' , '03' , 99)
insert into SC values('02' , '01' , 70)
insert into SC values('02' , '02' , 60)
insert into SC values('02' , '03' , 80)
insert into SC values('03' , '01' , 80)
insert into SC values('03' , '02' , 80)
insert into SC values('03' , '03' , 80)
insert into SC values('04' , '01' , 50)
insert into SC values('04' , '02' , 30)
insert into SC values('04' , '03' , 20)
insert into SC values('05' , '01' , 76)
insert into SC values('05'


Ïà¹ØÎĵµ£º

sql³£ÓÃÓï¾ä¼¯½õ

--Óï ¾ä ¹¦ ÄÜ
--Êý¾Ý²Ù×÷
SELECT --´ÓÊý¾Ý¿â±íÖмìË÷Êý¾ÝÐкÍÁÐ
INSERT --ÏòÊý¾Ý¿â±íÌí¼ÓÐÂÊý¾ÝÐÐ
DELETE --´ÓÊý¾Ý¿â±íÖÐɾ³ýÊý¾ÝÐÐ
UPDATE --¸üÐÂÊý¾Ý¿â±íÖеÄÊý¾Ý
--Êý¾Ý¶¨Òå
CREATE TABLE --´´½¨Ò»¸öÊý¾Ý¿â±í
DROP TABLE --´ÓÊý¾Ý¿âÖÐɾ³ý±í
ALTER TABLE --ÐÞ¸ÄÊý¾Ý¿â±í½á¹¹
CREATE VIEW --´´½¨Ò»¸öÊÓͼ
DRO ......

SQl Create Table has error=>is not valid...

½ñÌìÏÂÁ˸öWIN7µÄÓ¢ÎÄ°ü°Ñϵͳ»»³ÉÓ¢Îĵġ£¸Ð¾õ»¹ÐУ¬¿ÉÊǵ±´´½¨Êý¾Ý¿â±íʱ·¢ÏÖ³ö´íÁË£¬²éÁËϲÅÖªµÀÊÇSQLµÄÅÅÐò³öÎÊÌâÁË
ÏÂÃæÊÇCTRL+c V¸ã¹ýÀ´µÄ£¬Ö»ÊÇ·½±ã´ó¼ÒÓÐÕâÑùµÄÎÊÌâ¿ÉÒԵõ½½â¾ö
ʹÓÃSQL2005½øÐд´½¨Êý¾Ý¿âµÄʱºò£¬Èç¹ûÓöµ½´´½¨Ê§°ÜµÄÇé¿ö£¬ÈçÏ£º
Create ¶ÔÓÚ Êý¾Ý¿â“xxxx”ʧ°Ü¡£ (Microsoft.SqlS ......

SQL Select IntoÓï¾ä


SQL Select IntoÓï¾ä
The SELECT INTO Statement
SELECT INTO Óï¾ä
The SELECT INTO statement is most often used to create backup copies of tables or for archiving records.
SELECT INTOÓï¾ä³£ÓÃÀ´¸øÊý¾Ý±í½¨Á¢±¸·Ý»òÊÇÀúÊ·µµ°¸¡£
Syntax
Óï·¨
SELECT column_name(s) INTO newtable [IN externaldatabase] ......

SQL*Loader¿ØÖÆÎļþ

±¾ÎÄÕë¶ÔSQL*Loader¿ØÖÆÎļþ½øÐÐ˵Ã÷¡£
Ò»£ºSQL*Loader¿ØÖÆÎļþµÄÄÚÈÝ
SQL*Loader¿ØÖÆÎļþʹÓÃDDLÃüÁîÀ´¿ØÖÆSQL*Loader»á»°µÄÒÔÏÂÏîÄ¿£º
¡ñʹÓÃSQL*Loaderµ¼ÈëÊý¾ÝµÄλÖÃ
¡ñÊý¾Ý¸ñʽÉ趨·½·¨
¡ñµ¼ÈëÊý¾ÝʱSQL*LoaderµÄÉ趨¡££¨ÄÚ´æ¹ÜÀí¡¢±»¾Ü¾ø¼Ç¼¡¢µ¼Èë´¦ÀíµÄÖжϵȣ©
¡ñµ¼ÈëʱÊý¾ÝµÄ´¦Àí·½·¨
¿ØÖÆÎļþÀý£ºemp.ctl ......

SQL SERVER 2008 Êý¾Ý±ä¸ü²¶»ñ(CDC )

SQL SERVER 2008 Òì²½²¶»ñ±íÊý¾ÝÐÞ¸Ä
 
дµÄ²»¶ÔµÄµØ·½Çë¸÷λָÕý£¬Ð´µÄÒ²±È½ÏÂÒ¡£½²¾¿Õâ¿´°É¡£^ ^
/*
SQL SERVER 2008 Òì²½²¶»ñ±íÊý¾ÝÐÞ¸Ä
 
 
SQL server 2008ΪÒì²½¸ú×ÙËùÓз¢ÉúÔÚÓû§±íÉϵÄÊý¾ÝÐÞ¸ÄÌṩÁËÄÚ½¨µÄ·½·¨,
¶ø²»ÐèÒª±àд×Ô¶¨ÒåµÄ´¥·¢Æ÷»òÕß²éѯ,±ä¸üÊý¾Ý²¶»ñÓµÓÐ×îСÐÔÄÜ¿ªÏú,¿ÉÒÔ
Ó ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ