Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam C2090-616 All Questions

View all questions & answers for the C2090-616 exam

Exam C2090-616 topic 1 question 56 discussion

Actual exam question from IBM's C2090-616
Question #: 56
Topic #: 1
[All C2090-616 Questions]

Below are the SQL statements a DBA is planning to execute on a database:
CREATE TABLE t1 (name VARCHAR (1));
INSERT INTO t1 VALUES ("˜A'), ("˜B'), ("˜C'), ("˜D');
ALTER TABLE t1 ALTER COLUMN name SET DATA TYPE INT;
What will be the outcome of the last statement?

  • A. The statement will fail due to variable length character error
  • B. The statement will fail due to an incompatible data type error
  • C. The statement will execute successfully and it deletes the character data
  • D. The statement will execute successfully and it internally converts the character data into ASCII numbers
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️
Reference: https://dev.mysql.com/doc/refman/5.5/en/alter-table.html

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
JamesBond
3 years, 4 months ago
Answer is B [db2inst2@vbox1 ~]$ db2 "CREATE TABLE t11 (name VARCHAR (1))" DB20000I The SQL command completed successfully. [db2inst2@vbox1 ~]$ db2 "INSERT INTO t11 VALUES ('A'), ('B'), ('C'), ('D')" DB20000I The SQL command completed successfully. [db2inst2@vbox1 ~]$ db2 "ALTER TABLE t11 ALTER COLUMN name SET DATA TYPE INT" DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL0190N ALTER TABLE "T11" specified attributes for column "NAME" that are not compatible with the existing column. SQLSTATE=42837 [db2inst2@vbox1 ~]$
upvoted 1 times
...
db2tester
5 years, 1 month ago
The good answer is "B- The statement will fail due to an incompatible data type error". Indeed, the reference with MySQL is totally wrong. With Db2, you get the error SQL0190N ALTER TABLE "T1" specified attributes for column "NAME" that are not compatible with the existing column. SQLSTATE=42837
upvoted 3 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 ...