in Databases retagged by
534 views
7 votes
7 votes

Consider the table ‘employee’ having two columns: 'EmpNo' and 'EmpName'.

Run the following transaction on the table:

COMMIT;
ALTER TABLE employee
ADD PhoneNo varchar(10);
ROLLBACK;

What are the columns in the table after the above operation?

  1. EmpNo  PhoneNo  
  2. EmpNo  EmpName
  3. Same as (B) but will throw an error indicating failed transaction
  4. EmpNo  EmpName  PhoneNo
in Databases retagged by
by
534 views

1 comment

@Bikram sir, so that means rollback and commits are only meaningful for transactions. Am I right?
0
0

1 Answer

17 votes
17 votes
Best answer
Answer D

Reason:-

You cannot rollback a DDL operation like ALTER TABLE because DDL is implicitly committed.
selected by

4 Comments

Perfect Explanation!
0
0
BUT, can DML commands be rolled back?
0
0
I think we can do rollback for DML.

Until a transaction is committed, it can be rolled back (undone)
0
0
It really depends on the type of database you are using
0
0
Answer:

Related questions