学习笔记(02):MySQL数据库从入门到实战应用-DML:插入、修改、删除数据

立即学习:https://edu.csdn.net/course/play/27328/362520?utm_source=blogtoedu

create table contacts(
    id int not null auto_increment primary key,
    name varchar(50),
    sex tinyint default 1,
    phone varchar(20)
)
 

desc contacts;

 


insert into contacts(name,sex,phone) values('张三',1,'13900000000');
insert into contacts(name,sex,phone) values('Tom\'s cat',1,'13900000001');
insert into contacts(name,sex,phone) values("Lily's cat",1,'13900000002');
insert into contacts(name,phone) values('李四','13900000003'),('王五','13900000004'),('赵六','13900000005');

update contacts set sex=2 where id=6;

update contacts set sex=2,phone='18900001111' where id=5;

delete from contacts where id=2;

delete from contacts;

你可能感兴趣的:(研发管理,数据库,mysql,MySQL,设计,语言)