Ask Your Question
3

Is it unnecessary to have both a default value and a not null constraint in defining an SQL column?

asked 2023-04-03 11:00:00 +0000

huitzilopochtli gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2022-03-21 05:00:00 +0000

devzero gravatar image

It is not necessary to have both a default value and a not null constraint in defining an SQL column. When a default value is set for a column, it automatically implies that the column cannot be null. However, it is good practice to explicitly define the not null constraint for clarity and to ensure data integrity.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-04-03 11:00:00 +0000

Seen: 10 times

Last updated: Mar 21 '22