标签:
create database foo chareset utf8;
create table foo(
user_name varchar(20),
age int,
signup_date date
);
insert into foo values(‘iwen‘,‘28‘,‘2015-01-01‘);
select * from foo;
select name, age, signup_date from foo;
insert into foo values(‘ime‘,‘21‘,‘2015-12-21‘);
select * from foo where user_name = ‘iwen‘;
select * from foo where user_name = ‘iwen‘ and age = 28;
update foo set age = 30 where user_name = ‘iwen‘;
select * from foo;
delete from foo where user_name = ‘iwen‘;
alter table foo add email varchar(50);
alter table foo drop email;
alter table foo change age user_age int;
alter table foo change user_age tinyint(1) not null;
alter table foo rename user_tbl;
drop table user_tbl;
标签:
原文地址:http://www.cnblogs.com/htmlphp/p/4844062.html