How to set a number by default using MYSQL
Let's say we have andatabase named: ExcelNovtech and a tables with the same name and we have a column called LimiteCarte and we want to set 10 000 as value by default .
Do the following:
create database excelnovtech;
use excelnovtech;
create table excelnovtech (
id INT(11) NOT NULL AUTO_INCREMENT,
depense double,
montantCompte double,
limiteCarte double default 1000,
PRIMARY KEY (id) )
ENGINE = InnoDB
AUTO_INCREMENT = 4
DEFAULT CHARACTER SET = utf8;
Here is an image:
Commentaires
Enregistrer un commentaire