devi definire CODICE_NOTA come campo INT AUTOINCREMENT.
ad ogni inserimento si incrementerà anche se tu non lo metti nel codice sql dell'INSERT