C is the correct answer. Checked by using Oracle Live SQL.
At first, it appears A is the correct answer. It is the correct answer if our employees table was empty. However, re-reading the question, it says the table has 100 rows. Therefore, option A when run on a table that has data gives an error - "ORA-01758: table must be empty to add mandatory (NOT NULL) column ".
on the other hand, option C works perfectly well if the table has 0 rows or 100 rows.
Correct answer is C:
a) SQL> alter table product
2 add salary number (8,2) not null;
alter table product
*
ERROR at line 1:
ORA-01758: table must be empty to add mandatory (NOT NULL) column
c) SQL> alter table product
2 add
3 salary number(8,2) default 0 not null;
upvoted 1 times
...
...
...
Log in to ExamTopics
Sign in:
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.
webdata
2 years, 11 months agobongtrader
3 years, 11 months agoBrasil
4 years, 7 months agoLif
5 years, 2 months agocnyce
5 years, 7 months agoAndy840
5 years, 4 months agoluizyto
5 years, 3 months ago