# 创建users表
create table users (user_id int(5) primary key auto_increment,
user_name varchar(30) not null,
user_sex int(1),
user_birthday datetime);
# 查询所有数据
select user_id,user_name,user_sex,user_birthday from users;
# 查询用户根据用户id
select user_id,user_name,user_sex,user_birthday from users where user_id=1;
# 添加数据
insert into users (user_id,user_name,user_sex,user_birthday) values
(10,"张三",1,'1996-01-03');
# 自增长字段可不用添加数据
insert into users (user_name,user_sex,user_birthday) values
(‘张三’,1,'1996-01-03');
# 删除数据
delete from users where user_id = 1;
# 更新数据
update users set user_name='',user_sex=2, user_birthday='' where user_id = 1;