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

²âÊÔÒ»ÏÂ×Ô¼ºµÄSQLˮƽ

 
create table Student(Sname varchar(10),Ssex varchar(5),Sage int,S# int)
insert into Student
select 'ÏÄÁÁ','ÄÐ','21','1004'
select '³Éƽ','ÄÐ','20','1001' union all
select 'Íõ²¨','ÄÐ','19','1002' union all
select 'ͻȻ','Ů','19','1003'
 
create table Course(C# varchar(10),Cname varchar(10),T# varchar(10))
insert into Course
select '006','»¯Ñ§','C06' union all
select '005','Êýѧ','C06' union all
select '004','µØÀí','C05' union all
select '001','×ÔÈ»','C02' union all
select '002','Éç»á','C01' union all
select '003','ÐÄÀí','C03'
 
 
IF EXISTS (SELECT 1 from SC)
    DROP TABLE SC
GO
create table SC(S# int,C# varchar(10),score int)
insert into SC
select '1004','002',13 union all
select '1004','004',13 union all
select '1004','005',13 union all
select '1004','006',13 union all
select '1004','001',13 union all
select '1004','003',35 union all
select '1003','002',95 union all
select '1003','001',55 union all
select '1001','006',55 union all
select '1001','005',100 union all
select '1001','001',100 union all
select '1002','001',null union all
select '1001','002',90 union all
select '1003','003',68
 
create table Teacher(T# varchar(10),Tname varchar(10))
insert into Teacher
select 'C04','ÌìÀïºÆ'union all
select 'C05','ÌìÈκÆ'union all
select 'C03','Á¢Ð¡Àö'union all
select 'C02','ÖìÁзò'union all
select 'C01','ÌìÈκÆ'union all
select 'C04','ÌìÀïºÆ'union all
select 'C06','Ҷƽ'
 
select * from Course
select * from SC
select * from student
 
--Student(S#,Sname,Sage,Ssex) ѧÉú±í
--Course(C#,Cname,T#) ¿Î³Ì±í
--SC(S#,C#,score) ³É¼¨±í
--Teacher(T#,Tname) ½Ìʦ±í
 
--ÎÊÌ⣺
--1¡¢²éѯ“”¿Î³Ì±È“”¿Î³Ì³É¼¨¸ßµÄËùÓÐѧÉúµÄѧºÅ:
select distinct S# from SC as sc where
(select score from sc as sc1 where c#='001' and sc1.s#=sc.s#)>
(select score from sc as sc2 where c#='002' and sc2.s#=sc.s#)
 
select S# from SC s where C#='001' and  score


Ïà¹ØÎĵµ£º

¡¾×ª¡¿ ¹ØÓÚPL/SQLÖжԴ洢¹ý³Ìadd debug information

¹ØÓÚPL/SQLÖжԴ洢¹ý³Ìadd debug information
http://space.itpub.net/13129975/viewspace-626245
 
Èç¹ûʹÓÃPL/SQL DeveloperÖÐÑ¡ÔñÒ»¸ö´æ´¢¹ý³Ìdebugµ«ÓÖdebug²»½øÈ¥£¡
½â¾öÕâ¸öÎÊÌâÊǺܼòµ¥µÄ£¬Ö»ÐèÒªÔÚPL/SQL DeveloperÖÐÑ¡ÔñÒªdebugµÄ´æ´¢¹ý³Ì£¬È»ºóµãÓÒ¼ü£¬ÔÚµ¯³öµÄ²Ëµ¥ÖÐÑ¡Ôñ"Add debug information"ºóÔÙÖ ......

SQL ѧϰ±Ê¼ÇÖ®Ë÷Òý

----use pubs-sales
-----´´½¨Ë÷Òý
create index index_name
on authors(au_lname)
--´´½¨Ë÷Òýºó±íÖÐËùÓеÄÊý¾Ý¸ú֮ǰûÓÐÇø±ð
select * from authors
--µ¥¶À²éË÷ÒýÁÐ
select au_lname from authors
--Ç¿ÖÆÊ¹Ó÷Ǵؼ¯Ë÷Òý
select * from  authors with(index(index_name))
--¶à×ֶηǴؼ¯Ë÷Òý
create inde ......

sql2005 Á´½Ó·þÎñÆ÷ Á¬½ÓOracle...

Ò»¡¢½¨Á¢Á´½Ó·þÎñÆ÷
       ÓÐÈËϲ»¶µ÷ÓÃϵͳ¹ý³ÌÀ´½¨Á¢£¬µ«ÎÒ¸öÈ˶Ôϵͳ¹ý³ÌûÓÐÌØ±ðµÄѧϰ £¬ËùÒÔÓõÄÊǽçÃæÉèÖ㬵±È»ÓÐÐËȤҲ¿ÉÒÔÑо¿Ò»Ïµģ¬ÒòΪ¿ÉÒÔ°ÑSQLÖ´Ðе¼³öÀ´¡£
USE [master]
GO
EXEC master.dbo.sp_addlinkedserver @server = N'TEST2', @srvproduct=N'ORCL', @provider=N ......

SQL Server2005 ÖÐÓà Pivot Éú³É½»²æ±í

×î½üÔÚ×öÒ»¸öÊý¾Ýͳ¼Æ£¬ÒªÇó¶ÔÒ»¸ö±íÖеÄÊý¾Ý°´ÕÕÁ½¸öά¶È³ÊÏÖ£¬Ò²¾ÍÊÇ´«Í³µÄ½»²æ±í
±ÈÈ磬ÓÐÒ»¸öÎÊÌâ±í£¬ÓÐÈý¸ö×ֶΣ¬£¨±êÌâ¡¢ÎÊÌâÀà±ð¡¢ÎÊÌâ״̬£©
ÒªÇó°´ÕÕ²»Í¬µÄÀà±ð£¬·Ö±ðͳ¼Æ´¦¸÷¸ö״̬µÄÎÊÌâÊýÁ¿£¨È磺²úÆ·ÎÊÌâÖÐδ´¦ÀíµÄÊýÁ¿¡¢·þÎñÎÊÌâÖÐÒÅÁôÎÊÌâÊýÁ¿µÈµÈ£©¡£
¾­¹ý²éÕҺͳ¢ÊÔ£¬ÖÕÓÚÉú³ÉÁ˽á¹û£¬ÏÖÔÚ·ÖÏí¸ø´ó¼Ò¡£ ......

SQL Server Compact²»Í¬°æ±¾µÄ°²×°°ü£¨×ª£©

2010-01-13 23:22
ÕªÒª£ºSQL Server CompactµÄ°²×°°üÓÉÈý²¿·Ö¹¦ÄÜ×é³É£¬²¢ÇÒÇø·ÖCPUƽ̨ºÍ²Ù×÷ϵͳƽ̨£¬³õѧÕßÍùÍù²»ÖªµÀÈçºÎÈ¥Çø·ÖËüÃÇ¡£±¾ÎĽ«¶ÔSQL Server CompactµÄ°²×°°ü½øÐнéÉÜ£¬ÈÃÄãÖªµÀÈçºÎÇø·ÖºÍÑ¡ÔñËüÃÇ¡£
Èç¹ûÄãÊÇʹÓÃVisual Studio 2005/2008¿ª·¢.NET Compact FrameworkÓ¦ÓóÌÐò£¬²¢ÔÚ³ÌÐòÖÐÓõ½ÁËSQL Serv ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ