MySQL column defaults - advantages/disadvantages and should I use for all columns?
default, default-value, mysql, null
Solution
1) What are the advantages and disadvantages of supplying a default value for columns in a table?
Advantages are that you can set the default, rather than using the standard default. This also simplifies insert statements in that you don't need to specify so many values.
No real disadvantages as long as you have reasonable defaults.
2) Furthermore, should all columns have default values? I mean, seems like a good idea... why not? :)
This really depends on your business logic. For instance if there is a column like CUSTOMER_NAME which you could not possibly come up with a good default value, then you should not specify a default. But for other columns like ACTIVE or DELETED that could be true or false, you should probably specify a default.
I hope this answers your questions.
Problem
1) What are the advantages and disadvantages of supplying a default value for columns in a table? 2) Furthermore, should all columns have default values? I mean, seems like a good idea... why not? :) Many thanks