CIW
1D0-441 · Question #140
Consider the following code fragment: 1. Statement s = conn.createStatement(); 2. 3. s.executeUpdate(CREATE TABLE MyTable ( + 4. ColumnA CHAR(5), + 5. ColumnB CHAR(5))); 6. 7. s.executeUpdate(INSERT…
The correct answer is C. BBBBB. See the full explanation below for the reasoning.
Question
Consider the following code fragment: 1. Statement s = conn.createStatement(); 2. 3. s.executeUpdate(CREATE TABLE MyTable ( + 4. ColumnA CHAR(5), + 5. ColumnB CHAR(5))); 6. 7. s.executeUpdate(INSERT INTO MyTable VALUES ( + 8. '00001', 'AAAAA'); 9. s.executeUpdate(UPDATE MyTable + 10. SET ColumnB = 'BBBBB' + 11. WHERE ColumnA = '00001'); 12. 13. ResultSet rs = s.executeQuery(SELECT * FROM MyTable + 14. WHERE ColumnA = '00001'; 15. while (rs.next()) 16. System.out.println(rs.getString(2)); Assume that variable conn references a valid and open Connection object, and that the database does not already contain a table named MyTable. Which output is generated?
Options
- A00001
- BAAAAA
- CBBBBB
- DNo output is generated.
How the community answered
(49 responses)- A10% (5)
- B14% (7)
- C71% (35)
- D4% (2)
Community Discussion
No community discussion yet for this question.