1z0-071 Exam QuestionsBrowse all questions from this exam

1z0-071 Exam - Question 191


Examine these statements:

Which is true about modifying the columns in ALTER_TEST?

Show Answer
Correct Answer: BE

To determine the correct answer, it is important to understand the constraints and possibilities of modifying columns in an Oracle table using the ALTER TABLE statement. Columns can typically be modified to change their data type as long as certain conditions are met. The key condition here is that reducing the length of a VARCHAR2 column is only possible if the current data fits within the new length, and similarly, increasing the precision or scale of a NUMBER column is possible, but reducing it is only possible if the current data fits within the new precision/scale. Given the provided code, it is possible to change c1 from VARCHAR2(10) to VARCHAR2(5) and c2 from NUMBER(10) to NUMBER(12,2) without violating these rules. Therefore, the correct answer is that c1 can be changed to VARCHAR2(5) and c2 can be changed to NUMBER(12,2).

Discussion

7 comments
Sign in to comment
jfc1Option: E
Feb 16, 2023

E is correct

DarnunOption: E
Apr 3, 2023

E is right answer. Column must be empty to change datatype.

WingLOption: E
Jul 12, 2023

E Correct. create table a_test (c1 VARCHAR2(10), c2 NUMBER(10)); insert into a_test values ('123', 123); select * from a_test; commit; alter table a_test modify c1 VARCHAR2(5); alter table a_test modify c2 NUMBER(12,2); desc a_test; if alter table a_test modify c1 VARCHAR2(2); ORA-01441: cannot decrease column length because some value is too big

WingL
Jul 12, 2023

alter table a_test modify c2 NUMBER(15,2); - worked BUT alter table a_test modify c2 NUMBER(15); - don't worked ORA-01440: column to be modified must be empty to decrease precision or scale

zouveOption: E
Jul 4, 2023

E tested

McromeoOption: E
Dec 4, 2023

E is correct

yaya32Option: E
Jan 24, 2024

I think E is correct

Ayman_Khalifa
Jul 14, 2024

What makes A incorrect?