What do you want to do in the end
Except for NULL, I only want to extract columns with "no default value"
Q1.phpMyAdmin shows no default value, what does that mean? I would like to know how "no default" is handled internally.
After executing the following command, the column "NOT NULL with no default value" was displayed as "Default NULL."
show columns from table name;
The Default field indicates the default value assigned to this column.The explicit default value for this column is NULL
If the column definition does not contain a DEFAULT clause, this is NULL.
"If the column definition does not contain a DEFAULT clause, this is NULL" means which of the following?
Q2. Where can I find the information "NOT NULL with no default value" and "Do you have a NOT NULL constraint set?"
for the column?
I thought it was in INFORMATION_SCHEMA
.COLUMNS
, so I tried the SQL below, but I didn't understand it well
select*from`INFORMATION_SCHEMA`.`COLUMNS`where`TABLE_SCHEMA`='Table Name'
MySQL probably thinks that the default value is NULL and that the default value is not specified are equivalent.
Q2. Where can I find "NOT NULL with or without default values" and "Do you have NOT NULL constraints set?"
for columns?select IS_NULLABLE, COLUMN_DEFAULT from information_schema.columns where table_schema='table name';
represents NUNULL allowed 「 and カラムColumn default values.In other words, IS_NULLABLE
is NO
.
© 2024 OneMinuteCode. All rights reserved.