0
create table pessoas(
id int not null auto_increment,
nome varchar(50) not null,
nascimento date,
sexo enum('M','F'),
peso decimal(5,2),
altura decimal(2,2),
nacionalidade varchar(20) default 'Brasil',
primary key (id)
)default charset = utf8;
When I run
insert into pessoas(id,nome,nascimento,sexo,peso,altura,nacionalidade)
values
(DEFAULT,'JOAO PAULO', 2018-02-25,'M',90,1.68, DEFAULT);
is giving this result:
JOAO PAULO 0000-00-00 M 90.00 0.99 Brazil
You’re showing that error:
1 31 19:37:13 Enter into persons(id,name,birth,sex,weight,height,nationality,)
values (DEFAULT, 'JOAO PAULO', 2018-02-25,’M',90,1.68, DEFAULT)
1 Row(s) affected, 2 Warning(s):
1264 Out of range value adjusted for column 'birth' at Row 1
1264 Out of range value adjusted for column 'height' at Row 1 0.015 sec
Where am I going wrong?
Wouldn’t be the lack of quotation marks on the date of birth?
– Sam
'2018-02-25'
....– Sam
Missing quotes in other values tb.
– Sam
João Paulo, the best way to thank is to vote positive in the useful answers and mark an answer as "accepted"
– Jefferson Quesado
more where you have that option?
– joao paulo oliveira