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

oracleÁ·Ï°Ì⣨mldnÊÓƵ£©Ò»

1,Áгö×îµÍн½ð´óÓÚ1500µÄ¸÷ÖÖ¹¤×÷¼°´ÓÊ´˹¤×÷µÄÈ«²¿¹ÍÔ±ÈËÊý¡£
select job,count(empno) from emp
where job in(select job from emp group by job having min(sal)>1500)
group by job;
2£¬Áгöн½ð¸ßÓÚ¹«Ë¾Æ½¾ùн½ðµÄËùÓÐÔ±¹¤ËùÔÚ²¿ÃÅ£¬Éϼ¶Áìµ¼£¬¹«Ë¾µÄ¹¤×ʵȼ¶¡£
select e.ename,d.dname,m.ename,e.sal,sa.grade
from emp e,emp m,dept d,(select avg(sal) avg from emp) ed,salgrade sa
where e.mgr=m.empno(+) and e.deptno=d.deptno and e.sal >ed.avg and (e.sal between losal and hisal);
3£¬ÁгöÓëscott´ÓÊÂÏàͬ¹¤×÷µÄËùÓÐÔ±¹¤¼°²¿ÃÅÃû³Æ¡£
select e.ename,d.dname from emp e,dept d,(select job from emp where ename='SCOTT') ed
where e.job=ed.job and e.deptno=d.deptno and ename!='SCOTT';
4,ÁгöËùÓв¿ÃŵÄÏêϸÐÅÏ¢ºÍ²¿ÃÅÈËÊý¡£
select d.*,nvl(ed.cou,0)
from dept d,(select deptno,count(empno) cou from emp group by deptno) ed
where d.deptno=ed.deptno(+);
5,Áгö¸÷ÖÖ¹¤×÷µÄ×îµÍ¹¤×ʼ°´ÓÊ´˹¤×÷µÄ¹ÍÔ±ÐÕÃû(δÄܽ«Ïàͬ¹¤×ʵÄÈËÅųý£©¡£
select e.ename,e.job,e.sal
from emp e,(select min(sal) min from emp group by job) ed
where e.sal=ed.min;
6,Áгö¸÷¸ö²¿ÃŵÄmanager£¨¾­Àí£©µÄ×îµÍн½ð(²éѯ³öµÄÊǸ÷¸ö²¿Ãŵľ­ÀíµÄ¹¤×Ê£¬ÒòΪÿ¸ö²¿ÃÅÖ»ÓÐÒ»¸ö¾­Àí)¡£
select deptno,min(sal) from emp where job='MANAGER' group by deptno;
7,ÁгöËùÓÐÔ±¹¤µÄÄ깤×Ê£¬°´Äêн´ÓµÍµ½¸ßµÄ˳ÐòÅÅÐò¡£
select ename,((sal+nvl(comm,0))*12) sa from emp order by sa asc;
8,²é³öÿ¸öÔ±¹¤µÄÉϼ¶Ö÷¹Ü£¬²¢ÒªÇó³öÕâЩÖ÷¹ÜÖеÄнˮ³¬¹ý3000µÄ¡£
select distinct m.ename,m.sal
from emp e,emp m
where e.mgr=m.empno and m.sal>3000;
9,Çó³ö²¿ÃÅÃû³ÆÖдø'S'×Ö·ûµÄ²¿ÃÅÔ±¹¤µÄ¹¤×ʺϼƣ¬²¿ÃÅÈËÊý¡£
select distinct e.deptno,d.dname,ed.sum,ed.cou
from emp e,dept d,
(select deptno,sum(sal) sum,count(empno) cou from emp group by deptno) ed
where d.dname like '%S%' and e.deptno=ed.deptno and e.deptno=d.deptno;
10,¸øÈÎÖ°ÈÕÆÚ³¬¹ý29ÄêµÄÈ˼Óн10%¡£
update emp set sal=sal*1.1 where (sysdate-hiredate)/365>29;(¸üÐÂÊý¾Ý)
select ename,sal*(1+0.1) salh from emp where (sysdate-hiredate)/365>29;£¨½ö½öÊDzéѯ¼ÓнºóÊý¾Ý£©
11,ÁгöÔÚ²¿ÃÅ"SALES"(ÏúÊÛ²¿)¹¤×÷µÄÔ±¹¤µ


Ïà¹ØÎĵµ£º

OracleÊý¾Ýµ¼Èëµ¼³öimp/expÃüÁîʹÓÃ

OracleÊý¾Ýµ¼Èëµ¼³öimp/exp¾ÍÏ൱ÓÚoracleÊý¾Ý»¹Ô­Ó뱸·Ý¡£expÃüÁî¿ÉÒÔ°ÑÊý¾Ý´ÓÔ¶³ÌÊý¾Ý¿â·þÎñÆ÷µ¼³öµ½±¾µØµÄdmpÎļþ£¬impÃüÁî¿ÉÒÔ°ÑdmpÎļþ´Ó±¾µØµ¼Èëµ½Ô¶´¦µÄÊý¾Ý¿â·þÎñÆ÷ÖС£ ÀûÓÃÕâ¸ö¹¦ÄÜ¿ÉÒÔ¹¹½¨Á½¸öÏàͬµÄÊý¾Ý¿â£¬Ò»¸öÓÃÀ´²âÊÔ£¬Ò»¸öÓÃÀ´ÕýʽʹÓá£
 
Ö´Ðл·¾³£º¿ÉÒÔÔÚSQLPLUS.EXE»òÕßDOS£¨ÃüÁîÐУ©ÖÐÖ´ÐУ¬
......

oracle lob ¼òµ¥½éÉÜ

ºÎΪLOB£¿
lobΪoracleÊý¾Ý¿âµÄÒ»¸ö´ó¶ÔÏóÊý¾ÝÀàÐÍ,¿ÉÒÔ´æ´¢³¬¹ý4000bytesµÄ×Ö·û´®£¬¶þ½øÖÆÊý¾Ý£¬OSÎļþµÈ´ó¶ÔÏóÐÅÏ¢.×î´ó¿É´æ´¢µÄÈÝÁ¿¸ùoracleµÄ°æ±¾ºÍoracle ¿é´óСÓйØ.
ÓÐÄǼ¸Öֿɹ©Ñ¡ÔñµÄLOBÀàÐÍ?
Ä¿Ç°ORACLEÌṩÁËCLOB£¬NCLOB£¬BLOB£¬BFILE¹²ËÄÖÖLOBÀàÐÍ,CLOB,NLOBΪ´ó×Ö·û´®ÀàÐÍ,NLOBΪ¶àÓïÑÔ¼¯×Ö·ûÀàÐÍ,ÀàËÆÓÚNV ......

ÍêȫжÔØOracleÊý¾Ý¿â

ʵÏÖ·½·¨£º
1¡¢¿ªÊ¼->ÉèÖÃ->¿ØÖÆÃæ°å->¹ÜÀí¹¤¾ß->·þÎñ
Í£Ö¹ËùÓÐOracle·þÎñ¡£
2¡¢¿ªÊ¼->³ÌÐò->Oracle - OraHome81->Oracle Installation Products->
Universal Installer
жװËùÓÐOracle²úÆ·£¬µ«Universal Installer±¾Éí²»Äܱ»É¾³ý
5¡¢ÔËÐÐregedit£¬Ñ¡ÔñHKEY_LOCAL_MACHINESOFTWAREORACLE£¬°´ ......

oracleÐòÁÐÉú³ÉÆ÷(sequence)ʹÓõÄÒ»µãСעÒâ

ÓÐÈËÓöµ½Õâôһ¸öÎÊÌ⣬·ÃÎÊÒ»¸öÐòÁÐÔõô³ö´íÁË£¬´íÎóÈçÏ£º ORA-08002: ÐòÁÐ SEQ_GX.CURRVAL ÉÐδÔڴ˻ỰÖж¨Òå ÕâÊÇÒòΪÔÚÒ»¸öеĻỰÖУ¬ÐòÁÐÐèÒª³õʼ»¯£¬Ò²¾ÍÊÇͨ¹ý.NEXTVALÀ´Íê³ÉÐòÁеijõʼ»¯¡£ ²âÊÔÈçÏ£º Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 Connected as crmii SQL> SQ ......

ORACLE 10gÏÂÔصØÖ·

Oracle Database 10g Release 2 (10.2.0.1.0) Enterprise/Standard Edition for Microsoft Windows (32-bit)
http://download.oracle.com/otn/nt/oracle10g/10201/10201_database_win32.zip
http://download.oracle.com/otn/nt/oracle10g/10201/10201_client_win32.zip
http://download.oracle.com/otn/nt/oracle10g/10 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ