Databases · Junior · Question 8 of 75
How do you get an auto-incrementing ID column in modern PostgreSQL?
- 1
id int AUTO_INCREMENT - 2
id int DEFAULT next() - ✓Correct answer:
id bigint GENERATED ALWAYS AS IDENTITY
Explanation
Identity columns are the SQL-standard way. serial still works but is older. AUTO_INCREMENT is MySQL syntax.