做爰高潮a片〈毛片〉,尤物av天堂一区二区在线观看,一本久久A久久精品VR综合,添女人荫蒂全部过程av

最新文章專題視頻專題問答1問答10問答100問答1000問答2000關(guān)鍵字專題1關(guān)鍵字專題50關(guān)鍵字專題500關(guān)鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關(guān)鍵字專題關(guān)鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
當(dāng)前位置: 首頁 - 科技 - 知識百科 - 正文

自寫的非常不錯的oracle語句精選

來源:懂視網(wǎng) 責(zé)編:小采 時間:2020-11-09 16:16:19
文檔

自寫的非常不錯的oracle語句精選

自寫的非常不錯的oracle語句精選:Oracle 語句 精,一起探討吧 http://my.oschina.net/58685474 Oracle --在sqlplus中用system/svse連接 然后授權(quán)(grant dba to scott) 再將權(quán)限授予svse用戶(grant connect,resource to svse)----建立表空間svsespa
推薦度:
導(dǎo)讀自寫的非常不錯的oracle語句精選:Oracle 語句 精,一起探討吧 http://my.oschina.net/58685474 Oracle --在sqlplus中用system/svse連接 然后授權(quán)(grant dba to scott) 再將權(quán)限授予svse用戶(grant connect,resource to svse)----建立表空間svsespa

Oracle 語句 精,一起探討吧 http://my.oschina.net/58685474 Oracle --在sqlplus中用system/svse連接 然后授權(quán)(grant dba to scott) 再將權(quán)限授予svse用戶(grant connect,resource to svse)----建立表空間svsespace并建立svse用戶,建立如下表格 employee--建

Oracle 語句 精,一起探討吧
http://my.oschina.net/58685474
Oracle $velocityCount-->
--在sqlplus中用system/svse連接 然后授權(quán)(grant dba to scott) 再將權(quán)限授予svse用戶(grant connect,resource to svse)
----建立表空間svsespace并建立svse用戶,建立如下表格 employee
--建立表空間svsespace
create tablespace svsespace 
datafile 'd:\svse.dbf'
size 5m;
--建立svse用戶
create user svse
identified by svse123
default tablespace svsespace;
--建立如下表格 employee
create table employee
(
 empno number(8) primary key,
 ename varchar2(20),
 job varchar2(20),
 sal number(8),
 deptno number(4) references dept(deptno)
);

--建立如下表格Dept表
create table dept
(
 deptno number(4) primary key,
 dname varchar2(20),
 location varchar2(20)
);
--為Dept表添加數(shù)據(jù)
insert into dept values(10,'ACCOUNTING','武漢');
insert into dept values(20,'NEW YORK','北京');
insert into dept values(30,'BOSTON','上海');

--為employee表添加數(shù)據(jù)
insert into employee values(10001,'史密斯','職員',1000,10);
insert into employee values(10002,'瓊斯','分析員',3000,20);
insert into employee values(10003,'愛德華','經(jīng)理',5000,10);
insert into employee values(10004,'福特','職員',1200,10);
insert into employee values(10005,'艾倫','銷售員',10500,20);
insert into employee values(10006,'凱文','職員',1250,30);
insert into employee values(10007,'鮑勃','分析員',3200,30);
insert into employee values(10008,'貝克','經(jīng)理',11500,30);
insert into employee values(10009,'斯蒂文','會計(jì)師',6000,10);
insert into employee values(10010,'蘇珊','職員',600,20);

select * from employee;
select * from dept;

--為employee表的empno字段創(chuàng)建序列
create sequence seq_no
start with 10011
increment by 1;

----1.1	使用PLSQL實(shí)現(xiàn)數(shù)據(jù)的添加,要求接受輸入,然后將數(shù)據(jù)加到數(shù)據(jù)庫
declare
 myename employee.ename%type;
 myjob employee.job%type;
 mysal employee.sal%type;
 mydeptno employee.deptno%type; 
begin
 myename := '&請輸入員工姓名';
 myjob := '&請輸入員工工作';
 mysal := &請輸入員工工資;
 mydeptno := &請輸入部門編號;
 insert into employee values(seq_no.nextval,myename,myjob,mysal,mydeptno);
 dbms_output.put_line('添加成功');
end;
--1.2	添加數(shù)據(jù)時,要求如果工資高于10000或低于800,則拋出異常,并打印異常信息
declare
 myename employee.ename%type;
 myjob employee.job%type;
 mysal employee.sal%type;
 mydeptno employee.deptno%type; 
 errorsal exception;
begin
 myename := '&請輸入員工姓名';
 myjob := '&請輸入員工工作';
 mysal := &請輸入員工工資;
 mydeptno := &請輸入部門編號;
 --判斷輸入的工資是否大于10000或者小于800,如果是則拋出異常
 if mysal < 800 then
 raise errorsal;
 elsif mysal > 10000 then
 raise errorsal;
 else
 insert into employee values(seq_no.nextval,myename,myjob,mysal,mydeptno);
 dbms_output.put_line('添加成功');
 end if;
exception
 when errorsal then
 dbms_output.put_line('您輸入的工資范圍必須在800到10000之間');
end;
--1.3	在該模式下,創(chuàng)建一個序列SEQ_ORDER,該序列從1開始,到9999為止,且不能循環(huán)計(jì)數(shù)
create sequence seq_order
start with 1 
increment by 1
maxvalue 9999
nocycle;
--1.4	設(shè)計(jì)一個視圖,能顯示所有員工編號、名稱、工作、薪水、部門姓名,部門所在地。
--給svse用戶創(chuàng)建視圖的權(quán)限(在cmd中輸入grant create view to svse 賦予用戶svse創(chuàng)建視圖的權(quán)限)
create or replace view myview
as
 select a.*,location from employee a,dept b where a.deptno = b.deptno;
--查看視圖
select * from myview;
--2.	用存儲過程接受兩個數(shù)相除并且顯示結(jié)果,如果第二個數(shù)為0,則顯示消息“除數(shù)不能為0”。
create or replace procedure getNum(num1 number,num2 number)
as
 num number; 
begin
 num := num1 / num2; 
end;
--測試
declare
 num1 number;
 num2 number;
 num number := num1 / num2; 
begin
 num1 := &請輸入第一個數(shù);
 num2 := &請輸入第二個數(shù);
 if num2 = 0 then 
 dbms_output.put_line('除數(shù)不能為0');
 else 
 getNum(num1,num2); 
 dbms_output.put_line('所得值為;' || num1/num2);
 end if; 
end;
--3.	編寫一個存儲過程,接受一個員工名,從emp表中顯示該雇員的工作崗位與薪水,若輸入的雇員名不存在,顯示“該雇員不存在”信息。
create or replace procedure getInfo(myno emp.empno%type,myjob out emp.job%type,mysal out emp.sal%type)
as 
begin
 select job,sal into myjob,mysal from emp where empno = myno;
 dbms_output.put_line('獲得成功!'); 
end;
--測試
declare
 mysal emp.sal%type;
 myjob emp.job%type;
 inputempno emp.empno%type;
begin
 inputempno := &請輸入員工編號; 
 getInfo(inputempno,myjob,mysal);
 dbms_output.put_line('員工工作:'||myjob ||' 員工工資:'||mysal);
exception
 when no_data_found then 
 dbms_output.put_line('您輸入的員工編號有誤,請核對后重新輸入...'); 
end;
--4.	使用游標(biāo),接受一個部門號,從emp表中顯示該部門的所有雇員的姓名,工作和薪水(帶參數(shù)的游標(biāo))
declare
 type mycurtype is record(myename emp.ename%type,myjob emp.job%type,mysal emp.sal%type);
 cursor mycur(mydeptno emp.deptno%type) is 
 select ename,job,sal from emp where deptno = mydeptno;
 emprow mycurtype;
 theno emp.deptno%type;
begin
 theno := &請輸入部門編號;
 dbms_output.put_line('
輸出部門員工信息如下...'); open mycur(theno); loop fetch mycur into emprow; exit when mycur%notfound; dbms_output.put_line('姓名:'||emprow.myename||' 工作:'||emprow.myjob||' 薪水'||emprow.mysal); end loop; close mycur; end; --5. 編寫一個程序塊,從emp表中對名字以”A”或”S”開頭的所有雇員按他們基本薪水的10%給他們補(bǔ)貼, --如果該雇員的總工資(工資+補(bǔ)貼)超過1500元,按總工資的5%扣除個人所得稅,并輸出員工的應(yīng)得工資。 declare cursor mycur is select * from emp for update; mysal emp.sal%type; begin update emp set sal = sal * 1.1 where ename in( select ename from emp where ename like 'A%' or ename like 'S%'); for emprow in mycur loop if emprow.sal + emprow.comm > 1500 then mysal := (emprow.sal + emprow.comm) * 0.95; dbms_output.put_line('該員工的姓名為:'||emprow.ename||' 該員工的實(shí)際工資為:'||emprow.sal||' 該員工應(yīng)得工資為:'||mysal); end if; end loop; end; ----查詢emp表中ename以A或者S開頭的名字 select ename,sal from emp where ename like 'A%' or ename like 'S%'; /*****************************************************************/ --6. 當(dāng)更新emp表中的comm字段的值為空時,自動修改comm字段的值為’0’。 create or replace trigger tri_update after update on emp for each row begin end; select comm,ename,sal from emp; /*****************************************************************/ --7. 創(chuàng)建觸發(fā)器,實(shí)現(xiàn)當(dāng)某個部門被刪除時,就把相應(yīng)員工部門的名改為NULL。 create or replace trigger tri_delete after delete on dept for each row declare cursor mycur is select * from emp where deptno = :old.deptno for update; begin for emprow in mycur loop update emp set deptno = null where deptno = emprow.deptno; dbms_output.put_line('修改成功!'); end loop; end; --測試 delete from dept where deptno = 10 select * from dept; select * from emp; 轉(zhuǎn)載注明出處 http://my.oschina.net/58685474

聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

文檔

自寫的非常不錯的oracle語句精選

自寫的非常不錯的oracle語句精選:Oracle 語句 精,一起探討吧 http://my.oschina.net/58685474 Oracle --在sqlplus中用system/svse連接 然后授權(quán)(grant dba to scott) 再將權(quán)限授予svse用戶(grant connect,resource to svse)----建立表空間svsespa
推薦度:
標(biāo)簽: 寫的 精選 語句
  • 熱門焦點(diǎn)

最新推薦

猜你喜歡

熱門推薦

專題
Top
主站蜘蛛池模板: 广河县| 宝坻区| 淳化县| 通海县| 海盐县| 彭水| 育儿| 荔浦县| 平塘县| 洞口县| 海盐县| 观塘区| 定结县| 合川市| 阿合奇县| 抚州市| 姜堰市| 门头沟区| 奇台县| 桂林市| 来安县| 天水市| 达孜县| 旌德县| 成安县| 蓬溪县| 启东市| 青铜峡市| 平乐县| 罗城| 桂阳县| 武清区| 福清市| 龙山县| 固原市| 扎赉特旗| 谢通门县| 上犹县| 临高县| 深泽县| 泰和县|