First, signed number and unsigned number
In short, a signed number is a positive negative. Unsigned numbers are only positive.
Second, whether the setting is empty
Default null: defaults to NULL
NOT NULL: null is not allowed
Nothing to write: default is null, that is, the same defalut null
Date Type dates : Day of the month, that is, Xxxx-xx-xxdatetime: years and seconds, that is, xxxx-xx-xx XX:XX:XXtimestamptime: Only time, that is XX:XX:XXyear: only the year, That is XXXX
Example: Build a table with the following fields:
Inserts a row, both the current time.
The following results are performed:
To insert a specified date, the following methods are available:
The result after execution is:
Iv. the difference between char and varchar
Char is similar to varchar, and is used to save short strings in MySQL.
The main difference between the two lies in the different ways of storage:
The length of the char column is fixed to the length that is declared when the table is created, and the length can be any value from 0~255;
The value of the varchar column is a variable-length string, and the length can be specified as 0~255
MySQL Initial learning