MySQL learning (3): first acquainted with the data table

Open the database:

  • USE db_name : Open the database.

    Create the data table:

Check out the datasheet:

View the data table structure:

Simple insertion and search of data:

  • Insert: INSERT [INTO] tbl_name [(col_name)] VALUES(val1,val2,...);
  • Find: SELECT expression FROM tbl_name

Null and non-null:

  • If you do not specify empty and non-empty when creating a table, it can be empty by default.
  • When creating a table, you can add some corresponding attributes after the column name-data type

auto numbering:

Getting to know the primary key:

Primary key is not null

Unique constraint:

UNIUE KEY can be empty

Default constraints:

example:

  • Record lookup:

  • View data table structure

  • create:

Guess you like

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