create database mytest default charset=utf8 //創建數據庫
create table users //創建表
(
user_id int not null auto_increment,
user_name varchar(20) not null,
description varchar(200),
primary key PK_userid(user_id)
);
show create table users;//查看創建表的sql語句
desc users; //查看表結構
alter table users add(user_age int not null); //添加表字段
insert into users(user_name,description,user_age) values('chen','this is good men.',28); //插入一條數據
//查詢數據庫
select * from users limit 5; //查詢前5條
SELECT * FROM users LIMIT 6,2; //從弟6條開始,查2條