编辑代码

CREATE DATABASE pets;
use pets
CREATE TABLE pet_info(name varchar(32)primary key,
weight float,
height float,
type varchar(32),
age int,
color varchar(32));
insert into pet_info(name,
weight,
height,
type,
age,
color)
values('mike',3,28,'吉娃娃',10,'白'),
('sala',6.5,40,'柴犬',15,'黄'),
('黑狮',21.5,45,'藏獒',26,'黑'),
('大圣',15,42,'牧羊犬',20,'青'),
('boy',5.5,24,'蝴蝶犬',6,'白');
select name,type
from pet_info
where color='白';
select*
from pet_info
where weight<10 and height<30;
update pet_info
set height=26.5
where name='boy';
delete from pet_info
where type='牧羊犬';