Home » mysql » Providing default value for column

Providing default value for column

We can provide default value for a column. If we don specify its value then it will automatically assign a default value.
We can specify default value on table creation.

Syntax for adding default value is

for example

this will produce following output

while inserting any rowin table if we dont provide value for column that have default value that its default value will be inserted for example

We have inserted only name of product and value of quantity,price,status and add_date is assigned as default value.

Please follow and like us:
error