Hello everyone,
This is again for beginners, as a Trainer, it's my duty to educate the beginners/learners. Let's take an example below,
--Assume we already have 'EMP' table with the columns- id,name,Sal
Insert into Emp (id,name,sal) Values(1,'xyz',2200);
Create table test (Id number);
--Now check the contents of EMP in another session and you would that record is inserted even without committing. That is because there is a 'Create' statement after 'Insert', which is DDL and hence it auto commits the transaction.
-- Now try this in one of the sessions
Insert into Emp (id,name,sal) Values(2,'abc',1100); -- Inserts a record
Create table test (Id number); --This statement fails as 'test' already exists
--Don't commit anything here and check the contents of EMP in another session or rollback in the same session and check EMP table
So, how did that happen? If DDL got failed then who committed the transaction? It's a homework. Google it and find out.