Primary keys - the basics
Single-column primary keys
Multicolumn primary keys
Auto-increment columns and sequences
26. Auto-numbering in various databases
Revision

Instruction

Nice. As you can see, there are quite a few ways of auto-numbering in databases. Some of them only use IDENTITY (e.g. SQL Server), other take AUTO_INCREMENT (e.g. MySQL), and there are also such databases which only have sequences (e.g. PostgreSQL). So, each time you work with a new database, read the documentation and check which of the options are available.

Exercise

Press the button Next exercise to continue.

Console

Code editor

Result

TableConsole