AllExam Dumps

DUMPS, FREE DUMPS, VCP5 DUMPS| VMWARE DUMPS, VCP DUMPS, VCP4 DUMPS, VCAP DUMPS, VCDX DUMPS, CISCO DUMPS, CCNA, CCNA DUMPS, CCNP DUMPS, CCIE DUMPS, ITIL, EXIN DUMPS,


READ Free Dumps For Oracle- 1z0-001





Question ID 8071

Examine the structure of STUDENT table. NAME NULL TYPE STUDENT ID NOT NULL NUMBER(3) NAME NOT NULL VARCHAR2(25) PHONE NOT NULL VARCHAR2(9) ADDRESS VARCHAR2(50) GRADUATION DATE There are hundred records in the student table. You need to modify the Phone column to hold only numeric value. Which statement will modify the data type of the Phone column?

Option A

ALTER TABLE student MODIFY phone NUMBER(9)

Option B

ALTER STUDENT table MODIFY COLUMN phone NUMBER(9);

Option C

You can not modify a VARCHAR2 data type to a NUMBER data type for a

Option D

Column.

Option E

You cannot modify the data type of a column if there is data in the column.

Correct Answer E
Explanation Explanation/Reference: Explanation: Answer E is correct because Phone column in STUDENT table has NOT NULL constraint, which does not allows to modify data type of a column if there is data in the column. Incorrect Answers: A: The statement will fail because it is incorrect way to change data type for column with NOT NULL constraint on it. B: There is a wrong syntax 'ALTER STUDENT table' and 'MODIFY COLUMN' in the statement. C: It is possible to modify VARCHAR2 data type to NUMBER data type (with some restrictions). D: Does not exists in question Oracle 8, DBA Certification Exam Guide, Jason S. Couchman, p. 141-142 Chapter 4: Creating Other Database Objects in Oracle


Question ID 8072

You need to update employee salaries if the salary of an employee is less than 1000. The salary needs to be incremented by 10%. Use SQL*Plus substitution variable to accept the employee number. Which PL/SQL block successfully updates the salaries?

Option A

Declare V_sal emp.sal % TYPE; Begin SELECT Sal INTO V_sal FROM emp WHERE empno = and P_empno; IF (V_Sal<1000) THEN UPDATE emp INTO Sal := Sal*1.1 WHERE empno = and P_empno; END IF; END;

Option B

Declare V_sal emp.sal % TYPE; Begin SELECT Sal INTO V_sal FROM emp WHERE empno = and P_empno; IF (V_Sal<1000) THEN SAL := SAL * 1.1; END IF; END;

Option C

Declare V_sal emp.sal % TYPE; Begin SELECT Sal INTO V_sal FROM emp WHERE empno = and P_empno; IF (V_Sal<1000) THEN UPDATE emp Sal := Sal*1.1 WHERE empno = and P_empno; END IF; END; 

Option D

 Declare V_sal emp.sal % TYPE; Begin SELECT Sal INTO V_sal FROM empWHERE empno = and P_empno; IF (V_Sal<1000) THEN UPDATE emp Set Sal := Sal*1.1 WHERE empno = and P_empno; END IF; END;

Correct Answer D
Explanation Explanation/Reference: Explanation: Answer D is correct because it's using cursor and IF-THEN structure correctly to increase salary for all employees with current salary less than 1000. Incorrect Answers: A: UPDATE INTO is wrong construction for UPDATE command B: There is no SAL variable defined in PL/SQL block, so SAL:=SAL*1.1 will fail and it's wrong way to change value of column Sal in table EMP. C: Sal:=Sal*1.1 can not be inside UPDATE ... WHERE command. Oracle 8, DBA Certification Exam Guide, Jason S. Couchman, p. 215-217 Chapter 8: Introducing PL/SQL