Robert Sheldon creates some keys:
MySQL supports six basic types of constraints for ensuring data integrity:
PRIMARY
KEY
,NOT
NULL
,DEFAULT
,CHECK
,UNIQUE
, andFOREIGN
KEY
. In this article, I introduce you to each constraint type and provide examples for how they work. The examples include a series ofCREATE
TABLE
statements that demonstrate different ways to incorporate constraints into your table definitions. If you’re not familiar with theCREATE
TABLE
statement or how to create tables in a MySQL database, refer to an earlier article in this series that introduces you to the statement.
In short, they support the same set that SQL Server users are used to. But do read on to see the nuances behind each of these.