Prior to 12c, there was no direct relationship between a primary key and the sequence that maintained its value, so developers needed to implement this relationship via insert triggers or application code. So Oracle has come up with Identity Columns which combines two features, i.e. Automatic Columns & Create Sequence, into a simple package for creating table specific unique values.
CREATE TABLE TEST
(ID NUMBER GENERATED BY DEFAULT AS IDENTITY (START WITH 100 INCREMENT BY 1) PRIMARY KEY, NAME VARCHAR2(100));
When we insert into the table the ID column is automatically populated.
SQL> insert into TEST (text) values (‘Steve’);
1 row created.
select * from TEST;
When we created the table a sequence was also created.
SQL> select object_name, object_type from dba_objects where owner = ‘TEST’;
When we drop the table the sequence is left behind, and cannot be manually deleted.