exam questions

Exam 1z0-149 All Questions

View all questions & answers for the 1z0-149 exam

Exam 1z0-149 topic 1 question 18 discussion

Actual exam question from Oracle's 1z0-149
Question #: 18
Topic #: 1
[All 1z0-149 Questions]

Examine the EMPLOYEES table structure:

Now, examine this code:

Which statement is true about the result of executing this block?

  • A. It will execute successfully provided the salary of EMP_ID 200 does not exceed the value 99999.
  • B. It will return an error at line 2.
  • C. It will return an error at line 3.
  • D. It will return an error at line 8.
  • E. It will execute successfully by rounding up the salary of EMP_ID 200 to the appropriate value.
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
usarovsherzod68
5 months ago
In the code block, v_salary is declared as NUMBER(5), which can only store whole numbers up to 99999. so A is correct
upvoted 1 times
...
[Removed]
1 year, 3 months ago
Wouldn’t C be right once it doesn’t prefix the type with the table name?
upvoted 1 times
...
TheOracleWasTaken
1 year, 4 months ago
ORA-06502: PL/SQL: numeric or value error: number precision too large. Therefore answer is A
upvoted 1 times
...
jfc1
1 year, 7 months ago
Selected Answer: A
I think A is correct
upvoted 1 times
...
Goto10
1 year, 7 months ago
Seems like none of them is correct. Closest to the truth is A, but 99999.01 is greater than 99999 and still makes the program work... so as long as the rounded number does not exceed 6 digits it will work without an error.
upvoted 1 times
...
ISKV
1 year, 9 months ago
select salary, first_name from employees where employee_id = 200; --salary = 5400 update employees set salary = salary + 0.58 where employee_id = 200; commit; select salary, first_name from employees where employee_id = 200; --salary = 5400.58 declare first_name employees.first_name%type; v_name first_name%type; v_salary number(5); v_emp_id employees.employee_id%type := 200; begin select salary, first_name into v_salary, first_name from employees where employee_id = v_emp_id; dbms_output.put_line('v_salary is '||v_salary ||' first_name is '||first_name); end; --v_salary is 5401 first_name is George E is correct
upvoted 1 times
KOCE_1999
1 year, 8 months ago
No, you are incorrect. As you have showed in your example when the anonymous block is executed the number 5400.58 is rounded to 5401, so if the salary of employee 200 is bigger that 99999.49(for example 99999.50. The block will try to round the salary to 100000) that will get the error: ORA-06502: PL/SQL: numeric or value error: number precision too large and so the correct answer is A
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago