//创建表table_name-id自增长,itme2\itme2为字段,长度100,引擎innodb,字符utf8
create table if not exists `table_n...
//创建表table_name-id自增长,itme2\itme2为字段,长度100,引擎innodb,字符utf8 create table if not exists `table_name`( `id` int unsigned auto_increment, `itme1` varchar(100) not null, `itme2` varchar(100) not null, primary key ( `id` ) )engine=innodb default charset=utf8; //向表table_name全字段数据插入 insert into table_name values(null,'data1','data2'); //查询表table_name内所有数据 select * from table_name; //查询表table_name字段data1的所有数据 select data1 from table_name; //查询表table_name字段data1值为'xxx'的数据 select data1 from table_name where data1='xxx'; //更新数据 update table_name set data1 = 1,data2 = 2 where id =1 ; //删除数据 delete from table_name where id = 1;
发表评论