Use the COMMIT statement to save changes in the table create
Use the COMMIT statement to save changes in the table created in the above database. Use the SELECT * FROM your_table_name; command to display the content of the table (make sure to substitute your_table_name with the actual name of your table).
Use the ROLLBACK command to undo changes in the table created in the above database. What happened? Why? Use the SELECT * FROM your_table_name; command to display the content of the table (make sure to substitute your_table_name with the actual name of your table).
The following is the table that I`ve been working on.
create Table Erik(p_id number primary key);
Create table
Erik_Morataya
(
Id_number NOT NULL. Unique,
Lastname varchar2(20) NOT NULL,
Firstsname varchar2(20),
Gender char(10),
DOB date,
PRIMARY KEY(Id),
Foreign Key (Id) REFERENCES Erik(P_Id)
Check (Id>0)
);
Solution
1.COMMIT :-
* COMMIT is used to make the transaction permanent. so, we cannot undo or recall the statements.
Example :-
create Table Erik(p_id number primary key) ;
* INSERT INTO Erik VALUES(1021) ;
COMMIT ;
* The above DML operations are not possible to ROLLBACK. Because those operations are committed.
2.ROLLBACK :-
* ROLLBACK is used to cancel the operation which was performed on a table by the user and it will get the previous position of a table.
Example :-
create Table Erik(p_id number primary key) ;
* INSERT INTO Erik VALUES(1021) ;
ROLLBACK ;
* The above DML operations are possible to ROLLBACK. Because those operations are not committed on a table.

