Primary Key Create Table Feng (
Teamno int not null, playerno int not null, Division char (6) Not null, Primary Key (teamno) )
Create Table Feng (
Teamno int not null Primary Key , Playerno int not null, Division char (6) Not null,) composite primary key create table Feng (
Teamno int not null, playerno int not null, Division char (6) Not null, Primary Key (teamno, Playerno ) ) Alternative key (candidate key) Create Table Feng (
Teamno int not null Primary Key , Playerno int not null, Division char (6) Not null, Unique (playerno) ) Create Table Feng (
Teamno int not null Primary Key , Playerno int not null, Division char (6) Not null, Unique (playerno, Division ) ) Foreign key (used in InnoDB) The foreign key Declaration consists of three parts: 1. The column or column combination is a foreign key 2. Specify tables and columns for foreign key reference 3. For details, refer to [cascade (cascade operation), restrict (reject operation), set null (set to null), no action, set default]. If no reference action is specified, the default value is On update restrict On Delete restrict Create Table Feng (
Teamno int not null primary key, playerno int not null, Division char (6) Not null, Foreign key (Division) References othertable (column) On update restrict Unique (playerno )) Check integrity constraints Create Table players (playerno int not null, sex char (1) not null, check (sex in ('M', 'F '))) create Table players (playerno int not null, birth_date date, sex char (1) not null, check (sex in ('M', 'F ')) Joined smallint not null, Check (Year (birth_date) <joined ), Check (joined <1880 ), ) Create Table players (playerno int not null, birth_date date, sex char (1) not null, Check (sex in ( Select sex from wholetab ) )