204k views
0 votes
To set a column value to an initial value that is selected according to some business logic, you would use the SQL DEFAULT constraint with the CREATE TABLE command. True or False?

User Reveson
by
7.4k points

1 Answer

2 votes

Final answer:

It is true that the SQL DEFAULT constraint is used in the CREATE TABLE command to set an initial value for a column according to some business logic.

Step-by-step explanation:

The statement is True. In SQL, the DEFAULT constraint is used with the CREATE TABLE command to set an initial value for a column. This value will be inserted into the column whenever a new record is created without a specified value for that field. The initial value set by the DEFAULT constraint can follow some business logic, which determines what the default should be. For instance, a 'status' column might default to 'active' whenever no other status is specified during the insertion of a new record.

User Outcoldman
by
7.5k points