Tutorial by Examples

CREATE TABLE Employees ( Id int NOT NULL, PRIMARY KEY (Id), ... ); This will create the Employees table with 'Id' as its primary key. The primary key can be used to uniquely identify the rows of a table. Only one primary key is allowed per table. A key can also be composed by one...
Many databases allow to make the primary key value automatically increment when a new key is added. This ensures that every key is different. MySQL CREATE TABLE Employees ( Id int NOT NULL AUTO_INCREMENT, PRIMARY KEY (Id) ); PostgreSQL CREATE TABLE Employees ( Id SERIAL PRIMARY...

Page 1 of 1