首页 » 数据库辅导 » PL SQL代写 | Limited time test multiple choice questions

PL SQL代写 | Limited time test multiple choice questions

本次澳洲代写是一个PL SQL限时测试

Before you start this test, you need to create tables and insert data  using following commands:

CREATE TABLE dept ( deptno NUMBER(2) NOT NULL CONSTRAINT dept_pk PRIMARY KEY, dname VARCHAR2(14) NOT NULL CONSTRAINT dept_dname_uq UNIQUE, loc VARCHAR2(13) );

CREATE TABLE emp ( empno NUMBER(4) NOT NULL CONSTRAINT emp_pk PRIMARY KEY, ename VARCHAR2(10), job VARCHAR2(9), mgr NUMBER(4), hiredate DATE, sal NUMBER(7,2) CONSTRAINT emp_sal_ck CHECK (sal > 0), comm NUMBER(7,2), deptno NUMBER(2) CONSTRAINT emp_ref_dept_fk REFERENCES dept(deptno) );

CREATE TABLE jobhist ( empno NUMBER(4) NOT NULL, startdate DATE NOT NULL, enddate DATE, job VARCHAR2(9), sal NUMBER(7,2), comm NUMBER(7,2), deptno NUMBER(2), chgdesc VARCHAR2(80), CONSTRAINT jobhist_pk PRIMARY KEY (empno, startdate), CONSTRAINT jobhist_ref_emp_fk FOREIGN KEY (empno) REFERENCES emp(empno) ON DELETE CASCADE, CONSTRAINT jobhist_ref_dept_fk FOREIGN KEY (deptno) REFERENCES dept (deptno) ON DELETE SET NULL, CONSTRAINT jobhist_date_chk CHECK (startdate <= enddate) );

— — Load the ‘dept’ table —

INSERT INTO dept VALUES (10,’ACCOUNTING’,’NEW YORK’);

INSERT INTO dept VALUES (20,’RESEARCH’,’DALLAS’);

INSERT INTO dept VALUES (30,’SALES’,’CHICAGO’);

INSERT INTO dept VALUES (40,’OPERATIONS’,’BOSTON’);

— — Load the ’emp’ table —

INSERT INTO emp VALUES (7369,’SMITH’,’CLERK’,7902,’17-DEC-80′,800,NULL,20);

INSERT INTO emp VALUES (7499,’ALLEN’,’SALESMAN’,7698,’20-FEB-81′,1600,300,30);

INSERT INTO emp VALUES (7521,’WARD’,’SALESMAN’,7698,’22-FEB-81′,1250,500,30);

INSERT INTO emp VALUES (7566,’JONES’,’MANAGER’,7839,’02-APR-81′,2975,NULL,20);

INSERT INTO emp VALUES (7654,’MARTIN’,’SALESMAN’,7698,’28-SEP-81′,1250,1400,30);

INSERT INTO emp VALUES (7698,’BLAKE’,’MANAGER’,7839,’01-MAY-81′,2850,NULL,30);

INSERT INTO emp VALUES (7782,’CLARK’,’MANAGER’,7839,’09-JUN-81′,2450,NULL,10);

INSERT INTO emp VALUES (7788,’SCOTT’,’ANALYST’,7566,’19-APR-87′,3000,NULL,20);

INSERT INTO emp VALUES (7839,’KING’,’PRESIDENT’,NULL,’17-NOV-81′,5000,NULL,10);

INSERT INTO emp VALUES (7844,’TURNER’,’SALESMAN’,7698,’08-SEP-81′,1500,0,30);

INSERT INTO emp VALUES (7876,’ADAMS’,’CLERK’,7788,’23-MAY-87′,1100,NULL,20);

INSERT INTO emp VALUES (7900,’JAMES’,’CLERK’,7698,’03-DEC-81′,950,NULL,30);

INSERT INTO emp VALUES (7902,’FORD’,’ANALYST’,7566,’03-DEC-81′,3000,NULL,20);

INSERT INTO emp VALUES (7934,’MILLER’,’CLERK’,7782,’23-JAN-82′,1300,NULL,10);

— Load the ‘jobhist’ table —

INSERT INTO jobhist VALUES (7369,’17-DEC-80′,NULL,’CLERK’,800,NULL,20, ‘New Hire’);

INSERT INTO jobhist VALUES (7499,’20-FEB-81′,NULL,’SALESMAN’,1600,300,30, ‘New Hire’);

INSERT INTO jobhist VALUES (7521,’22-FEB-81′,NULL,’SALESMAN’,1250,500,30, ‘New Hire’);

INSERT INTO jobhist VALUES (7566,’02-APR-81′,NULL,’MANAGER’,2975,NULL,20, ‘New Hire’);

INSERT INTO jobhist VALUES (7654,’28-SEP-81′,NULL,’SALESMAN’,1250,1400,30, ‘New Hire’);

INSERT INTO jobhist VALUES (7698,’01-MAY-81′,NULL,’MANAGER’,2850,NULL,30, ‘New Hire’);

INSERT INTO jobhist VALUES (7782,’09-JUN-81′,NULL,’MANAGER’,2450,NULL,10, ‘New Hire’);

INSERT INTO jobhist VALUES (7788,’19-APR-87′,’12-APR-88′,’CLERK’,1000,NULL,20, ‘New Hire’);

INSERT INTO jobhist VALUES (7788,’13-APR-88′,’04-MAY-89′,’CLERK’,1040,NULL,20, ‘Raise’);

INSERT INTO jobhist VALUES (7788,’05-MAY-90′,NULL,’ANALYST’,3000,NULL,20, ‘Promoted to Analyst’);

INSERT INTO jobhist VALUES (7839,’17-NOV-81′,NULL,’PRESIDENT’,5000,NULL,10, ‘New Hire’);

INSERT INTO jobhist VALUES (7844,’08-SEP-81′,NULL,’SALESMAN’,1500,0,30, ‘New Hire’);

INSERT INTO jobhist VALUES (7876,’23-MAY-87′,NULL,’CLERK’,1100,NULL,20, ‘New Hire’);

INSERT INTO jobhist VALUES (7900,’03-DEC-81′,’14-JAN-83′,’CLERK’,950,NULL,10, ‘New Hire’);

INSERT INTO jobhist VALUES (7900,’15-JAN-83′,NULL,’CLERK’,950,NULL,30, ‘Changed to Dept 30′);

INSERT INTO jobhist VALUES (7902,’03-DEC-81′,NULL,’ANALYST’,3000,NULL,20, ‘New Hire’);

INSERT INTO jobhist VALUES (7934,’23-JAN-82′,NULL,’CLERK’,1300,NULL,10, ‘New Hire’);

 

Question 1 (1 point)

Which of the following code fragments would not raise an error?

Question 1 options:

CREATE OR REPLACE FUNCTION ship_calc(p_qty IN NUMBER)

RETURN NUMBER

IS

lv_ship_num NUMBER(5,2);

BEGIN

IF p_qty > 10 THEN

lv_ship_num := 11.00;

ELSE

lv_ship_num := 5.00;

END IF;

RETURN lv_ship_num;

END;

CREATE OR REPLACE FUNCTION  ship_calc(p_qty IN NUMBER)

IS

lv_ship_num NUMBER(5,2);

BEGIN

IF p_qty > 10 THEN

lv_ship_num := 11.00;

ELSE

lv_ship_num := 5.00;

END IF;

RETURN lv_ship_num;

END;

CREATE OR REPLACE  ship_calc(p_qty)

RETURN NUMBER

IS

lv_ship_num NUMBER(5,2);

BEGIN

IF p_qty > 10 THEN

lv_ship_num := 11.00;

ELSE

lv_ship_num := 5.00;

ENDIF;

RETURN lv_ship_num;

END;

CREATE OR REPLACE FUNCTION  ship_calc(p_qty IN NUMBER)

RETURN NUMBER

BEGIN

IF p_qty > 10 THEN

lv_ship_num := 11.00;

ELSE

lv_ship_num := 5.00;

END IF;

RETURN lv_ship_num;

END;

 

Question 2 (1 point)

The ____ mode type is considered constant because it cannot be changed within the procedure

Question 2 options:

OUT
IN OUT
INOUTIN
IN

程序辅导定制C/C++/JAVA/安卓/PYTHON/留学生/PHP/APP开发/MATLAB


本网站支持 Alipay WeChatPay PayPal等支付方式

E-mail: vipdue@outlook.com  微信号:vipnxx


如果您使用手机请先保存二维码,微信识别。如果用电脑,直接掏出手机果断扫描。

blank