-- Oracle Auto-increment id -- create a T_StudentInfo table create table T_StudentInfo ("id" integer not null primary key, xsName nvarchar2 (120) not null, xsAge integer not null, mobile varchar (12), Email varchar (50), Address nvarchar2 (300); -- create a sequence, sequence name: SEQ_StudentInfo_Identity -- create a sequence (sequence name rules generally start with SEQ, and then underline, followed by your table name, the T _ before the table name can be removed, end with _ Identity to indicate that this sequence is used in the sequence of Id auto-incrementing fields.) create sequence SEQ_StudentInfo_Identity increment by 1 -- add a few at a time, here I add 1 start with 1 each time -- count nomaxvalue from 1 -- do not set the maximum value nocycle -- always accumulate, do not cycle nocache; -- do not create a buffer -- you only have tables and sequences, you also need a trigger to execute it -- create a trigger whose name is Trg_Studentinfo_Identity -- I suggest that the trigger start with Trg _ followed by the table name, create trigger Trg_Studentinfo_Identity beforeinsert on T_StudentInfo for each row when (new. id is null) beginselect id_sequence.nextval into: new. id from dual; end;