mysql set id auto increment primary key directly while creating the table code example
Example 1: create table primary key auto increment mysql
define primary key auto increment
Example 2: auto increment psql not primary key
CREATE SEQUENCE cateogry_id_seq;
ALTER TABLE category ALTER COLUMN category_id SET DEFAULT nextval('cateogry_id_seq');