insert into 命令 添加insert into 表名(字段名1,字段名2....) values (值1,值2....)
delete 命令 删除 delete from 表名 where 删除条件
update 命令 修改 update 表名 set 字段1=值1, 字段2=值2,... where 修改条件
select 命令 查询 SELECT 字段名1, 字段名2 ..... FROM 表名 WHERE <条件表达式>
2.sql语句-创建表
-- 创建hero表,记录英雄信息
create table heros(
id int not null primary key auto_increment,//不能为空 主键 自动增加
name varchar(255) not null,
gender varchar(255),
img varchar(255),
isdelete tinyint default0//默认值0)
character set utf8;
-- 创建user表,用来记录用户注册信息
create table user(
id int not null primary key auto_increment,
username varchar(255) not null,
password varchar(255) not null)
character set utf8;
常用sql语句1.增删改查insert into 命令 添加insert into 表名(字段名1,字段名2....) values (值1,值2....)delete 命令 删除 delete from 表名 where 删除条件update 命令 修改 update 表名 set 字段1=值1, 字段2=值2,... where 修改条件select 命令 查询 SELECT 字段名1, 字段名2 ..... FROM 表名 WHERE <条件表达式>2.sql语句-创建表