Constraints: Set criteria to limit the data that is filled into the table, or to set properties on the data for a column in a table (for example: not full, the settings fill in the data is not empty)
Conditional filtering: Can be used to fill in a table or data from a table, the role is to meet certain conditions of their own (such as: Select when using where to get the data you want)
1.
Constraints are used to specify the characteristics of tabular data
2.
Constraints can be used to restrict the data type and characteristics of a table, which guarantees the reliability of tabular data, and data operations are aborted when data operations violate constraints
3. There are the following common constraints:
3.1
Not NULL (non-NULL)------guarantees that a column of data cannot have a null value
3.2
Unique------Ensure that a column of data is not duplicated (unique)
3.3
PRIMARY key (primary key)------union the "non-null" and "unique" attributes (that is, a column of data can not have null values can not be duplicated), the only one in the table to flag a row (that is, the meaning of this line)
3.4
FOREIGN key (foreign key)------used to mark a row of this table in another table or this table
3.5
CHECK------Ensure that a column of data meets a particular condition
3.6
The default------sets an initial value that is set to this value when the data is not assigned
3.7
INDEX------used to quickly create and retrieve data from a database
4. This is a constraint summary, I'll try these constraints later, (not full,unique,primary key has been tried in the blog that added the primary key)
(attached) MySQL: Learn SQL syntax on W3Schools documents (constraint summary)