Null to not null | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Null to not null

how make a column from null to not null

3rd Sep 2019, 7:50 AM
Fareedoon Khan
Fareedoon Khan - avatar
2 Answers
+ 1
You can change the content of the column with the UPDATE statement. You can change the table definition with the ALTER TABLE statement. The syntax may vary a bit among different database engines, for example in MySql it would be something like ALTER TABLE table_name MODIFY column_name VARCHAR(30) NOT NULL; If you have data in the table you may have to update all rows first that have null in this column.
3rd Sep 2019, 10:58 AM
Tibor Santa
Tibor Santa - avatar
0
table name Customers and column name ph1
4th Sep 2019, 9:08 AM
Fareedoon Khan
Fareedoon Khan - avatar