Complete the code to create a MySQL table with an auto-incrementing primary key.
CREATE TABLE users (id INT [1] PRIMARY KEY, name VARCHAR(100));
In MySQL, AUTO_INCREMENT is used to create a column that automatically increases its value for each new row.
Complete the code to create a PostgreSQL table with a serial primary key.
CREATE TABLE products (product_id [1] PRIMARY KEY, product_name TEXT);In PostgreSQL, SERIAL is a special data type that creates an auto-incrementing integer column.
Fix the error in the SQL Server table creation by completing the identity column syntax.
CREATE TABLE orders (order_id INT [1](1,1) PRIMARY KEY, order_date DATE);
In SQL Server, IDENTITY(1,1) defines an auto-incrementing column starting at 1 and incrementing by 1.
Fill in the blank to create a PostgreSQL table using the IDENTITY syntax for auto-increment.
CREATE TABLE employees (emp_id INT GENERATED [1] AS IDENTITY PRIMARY KEY, emp_name TEXT);PostgreSQL supports GENERATED BY DEFAULT AS IDENTITY to create auto-incrementing columns as a modern alternative to SERIAL.
Fill in the blanks to create a MySQL table with an auto-incrementing primary key and a default value.
CREATE TABLE sessions (session_id INT [1] PRIMARY KEY, user_id INT NOT NULL, status VARCHAR(20) DEFAULT [2]);
In MySQL, AUTO_INCREMENT creates an auto-incrementing column. The DEFAULT keyword sets a default value for a column.