【正文】
。為sal*12起一個(gè)別名nianxinselect ename, sal*12 nianxin: from emp。 去掉重復(fù)的。 選出名字為222的人。SDA39。//%是通配付一個(gè)或多個(gè)amp。按降序排序關(guān)鍵字order by四舍五入輸出24 select to_char(hiredate, 39。, 39。,39。交叉連接ename dname找出每種組合23,外連接select , from emp e1 left join emp e2 on ( = )。平均薪水最高的部門編號(hào)改天平均薪水的等級(jí)最低的部門名稱select dname, , grade, avg_sal from(select deptno, avg_sal, grade from(select deptno, avg(sal) avg_sal from emp group by deptno) ejoin salgrade s on ( between and hisal)) t1join dept on ( = )where =(select min(grade) from(select deptno, avg_sal, grade from(select deptno, avg(sal) avg_sal from emp group by deptno) ejoin salgrade s on ( between and hisal)))/比普通員工的最高薪水還要高的經(jīng)理人1)先選出哪些不是經(jīng)理人的最高薪水 select max(sal) from empwhere empno not in (select mgr from emp where mgr is not null)2)select ename, sal from empwhere sal (select max(sal) from empwhere empno not in (select mgr from emp where mgr is not null))and empno in (select distinct mgr from emp) 導(dǎo)出2create usercreate user username用戶名 identified by password密碼 default tablespace users默認(rèn)空間 quota 10M on users分配10M的空間3賦權(quán)限grant create session登錄, create table建表, create view to username。 ,在用戶中創(chuàng)建表時(shí)會(huì)出現(xiàn)以下的錯(cuò)誤:ORA01950: 表空間39。//相當(dāng)于emp2是emp的備份create v iew xxx as xxx。updateupdate emp2 set sal = sal * 2,ename = ename || 39。 exit之類 事務(wù)也提交一樣rollback不回去。3)主鍵約束create table stu(id number(9) unique,name varchar2(20),sdate date, varchar2(50),constraint saaa primary key (id))。添加alter table stu add constraint xxx foreign key(class) references class(id)。36,視圖就是一個(gè)虛表,create view v$_stu_info as select id, name, class from stu。)。 || v_name)。end。1234539。endrecord 相當(dāng)于類declaretype type_record_dept is record(deptno %type,dname %type,loc %typ)。end。)39。low39。end if。forbeginfor k in 1..10 loop(k)。aaa39。v_emp c%rowtype。rowtype相當(dāng)與C這是一表的類型beginopen c。c%foundCLERK39。end if。執(zhí)行后會(huì)提示過(guò)程已經(jīng)完成,但是他沒(méi)有執(zhí)行執(zhí)行方法1)exec p。end。 如果加上for each row ,而不是每次操作觸發(fā)一次beginif inserting theninsert into emp2_log values(USER, 39。, sysdate)。, 0, 0, 0)。瞎說(shuō)39。insert into article values (7, 39。, 2, 0, 2)。只需要在Oracle官方網(wǎng)站下載一個(gè)叫Instant Client Package的軟件就可以了,這個(gè)軟件不需要安裝,只要解壓就可以用了,很方便,就算重裝了系統(tǒng)還是可以用的。4. 安裝PLSQL Developer5. 配置PLSQL Developer(第一次可以不用登錄直接進(jìn)到PLSQL Developer)Tools Preferences Connections,Oracle Home內(nèi)容為 C:\oracleclientOCI library內(nèi)容為 C:\oracleclient\重新啟動(dòng)PLSQLDeveloper完畢create BITMAP index F2009100000NMINFOSYS_XIANG on f2009100000nminfo( SYS_XIANG )。創(chuàng)建索引:create index F2009100000NMINFOSYS_XIANG on f2009100000nminfo( SYS_XIANG )。螞蟻大戰(zhàn)大象大象被打趴下了螞蟻也不好過(guò)瞎說(shuō)下載oracle的客戶端程序包(30M)可能性是很大的39。, 4, 1, 3)。pid就是他的父IDinsert into article values (3, 39。end。u39。end if。因?yàn)樗莖ut numberv_temp number := 5。elsev_ret := v_b。創(chuàng)建存儲(chǔ)過(guò)程create or replace procedure pisbegin(39。end loop。close c。close c。)。end。i := i ++。)。單引號(hào)內(nèi)加語(yǔ)句IF關(guān)鍵字declarev_sal %type。create table T(te/st varchar2(20) default 39。1139。相當(dāng)于聲明一個(gè)數(shù)組類型v_empnos type_table_emo_empno。a date := sysdate。(v