|
·ÖÀർº½ |
 |
|
|
|
|
×ÊÔ´´óС£º10.08 KB |
×ÊÔ´ÀàÐÍ£ºÎĵµ |
ÏÂÔØ»ý·Ö£º 0 |
|
|
|
×ÊÔ´½éÉÜ |
|
Êý¾Ý¿â֪ʶ£¨SQL+ORACLE£©
¸ÅÊö
°²Ò×ϵͳµÄSQLÒÔ¼°ORACLEʹÓÃÏà¹Ø
Ò»¡¢SQL
SQL¹¤¾ß
Êý¾Ý±¸·ÝÒÔ¼°»¹Ô
1¡¢SQL¹¤¾ß
ÆóÒµ¹ÜÀíÆ÷:
²éѯ·ÖÎöÆ÷
2¡¢Êý¾Ý±¸·ÝÒÔ¼°»¹Ô
±¸·Ý
»¹Ô
3¡¢SQL Óï¾ä(DDL,DML,DCL)
Select Óï¾ä(group by ,having,order by asc/desc,union,union all,top,distinct)
Update: update a set
Delete: delete from tablename where ..
Create :create table tablename (column1,datatype)
Insert : insert into tablename () values ()
Drop:drop table tablename
¶þ¡¢ORACLE
ORACLE¹¤¾ß£¬PL/SQLµÄʹÓÃ
Êý¾Ý±¸·ÝÒÔ¼°»¹Ô
1¡¢ ORACLE»ù±¾¹¤¾ß
Enterprise manager console ÆóÒµ¹ÜÀíÆ÷
Sql plus
Net configuration assistant ÍøÂçÅäÖÃÖúÈë
Database configuration assistant Êý¾Ý¿âÅäÖÃÖúÊÖ
2¡¢ Êý¾Ý±¸·Ý¼°»¹Ô
¢Å±¸·Ý
ÎïÀí±¸·Ý(RMAN)¡úÒ»ÖÂÐÔ±¸·Ý(Êý¾Ý¿âÕý³£¹Ø±Õ),²»Ò»ÖÂÐÔ±¸·Ý(¹éµµÄ£Ê½)
Âß¼±¸·Ý(EXP)
¢Æ»¹Ô
ʵÀý»Ö¸´
½éÖʻָ´: shutdown immediate;startup mount;
3¡¢ PL/SQLµÄʹÓÃÒÔ¼°SQLÓï¾ä
ºÍSQLµÄÇø±ð:
Dual:oracle±ØÐëÓÐʵÀý¶ÔÏó,ÈçÎÞ¾ÍÓÃDUAL´úÌæ
Rownum:oracleȡǰ¼¸ÌìµÄÊý¾ÝûÓÐTOP¿ÉÓÃ,ÒªÓÃROWNUM
ÁÙʱ±í:select * into tablename from tablename
Create table tablename as select * from tablename
±ðÃû: select a=b from tablename
Select a b from tablename
Âß¼ÔËËã·û: &,bitand()
¶à±í¸üРupdate a,b set a.column=b.column;
Update a set a.column=(select column from b where a.column=b.column)
±êʶÁÐ
ÐòÁн¨Á¢:
create sequence SEQ_ZY_BFHZ
minvalue 1 maxvalue 9999 start with 1 increment by 1 nocache;
´¥·¢Æ÷½¨Á¢:
create or replace trigger tr_seq_zy_bfhz before insert on zy_bfhz for each row
begin select seq_zy_bfhz.nextval into :new.autoinc from dual; end tr_seq_zy_bfhz;
ÊÓͼ: create or replace view viewname as select ¡.
´¥·¢Æ÷:create or replace trigger trname after/before insert/unpdate/delete on tablename
Begin
If insert /update/delete
End;
¹ý³Ì create or replace procedure procedure_name
(parameter1 in Êý¾ÝÀàÐÍ,.....)
begin
sql Óï¾ä
end procedure_name
ϵͳ±í:sql:sysobjects
Oracle:all_tables
|
|
ÏÂÔØµØÖ· |
|
|
|
|
|