1、创建表:create table abc(id int(32) primary key,name varchar(32) unique,sex int(32));
primary key 在每一个表中只能有一个,primary key的意思就是主键,等同于唯一与not null,若其他字段也需要设置为唯一,那就在字段后加 unique(可以用多次)
2、查询数据:
select * from abc;
select * from abc where id="1";
3、插入数据:insert abc(name,sex) values("lianghao","1");
若要将所有的字段插入数据 insert abc values("1","kk","0");
4、修改数据:
update abc set name="kkii" where id=1;
5、删除数据:
delete from abc where id="1";(将abc表中id为1的数据删掉)