Home>

Currently, I want to create a table by executing code in MySQL when dealing with a database.

I don't understand the following points.

I will ask you a question with reference to the presented image.

1. What is Type? Is it okay to recognize that

type specifies a number or character string etc.?

2.Null, Key

I don't know what Null/Key/Extra is.
Moreover, although it is set as the primary key in the code, the effect is not understood.

As a trial, I am currently studying on the basis of dot installation, so I attended the course, but it was explained roughly and it is the current situation.

We also used Qiita for reference
Referenced articles

  • Answer # 1

       1. What is Type?   Is it okay to recognize that

    type specifies a number or character string etc.?

    int is an integer, and the number in () is the character limit.
    So int (11) is an integer and is within 11 digits.

       2. Null, Key   

    I don't know what Null/Key/Extra is.
      Moreover, although it is set as the primary key in the code, the effect is not understood.

    Does Null allow whitespace?

    Key specifies "Primary key (PRI)".