show databases; 查看所有数据库
create database oa;创建数据库oa
use oa;使用数据库oa
create table news(
id int primary key auto_increment,
title varchar(50),
content text,
publishday date);创建表news
show tables;查看所有表
desc news;查看表结构
insert into news(title,content,publishday)values
('明天放假','放假三天,注意安全',now());
insert into news(title,content,publishday)values
('明天放假','放假三天,注意安全aaaaaa',now());
select * from news;
select title from news;
delete from news where id=?;
update news set title ='?' where id=?;
alter table news add person varchar(20);/*添加字段*/
alter table news modify person varchar(30);/*修改字段*/
alter table news drop person;/删除字段
posted on 2009-03-31 11:35
鹏凌 阅读(106)
评论(0) 编辑 收藏