mySQL Constraints

Constraints are used to limit the type of data that is added to the table:

1. Specify constraints when creating a table (through the CREATE TABLE statement)

2. After the table is created (through the ALTER TABLE statement).

Constraint Type:

  • NOT NULL
  • UNIQUE (unique)
  • PRIMARY KEY
  • FOREIGN KEY
  • CHECK
  • auto_increment (auto-increment constraint)

DEFAULT (default)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325339397&siteId=291194637