show databases; 查看所有數(shù)據(jù)庫
create database oa;創(chuàng)建數(shù)據(jù)庫oa
use oa;使用數(shù)據(jù)庫oa
create table news(
id int primary key auto_increment,
title varchar(50),
content text,
publishday date);創(chuàng)建表news
show tables;查看所有表
desc news;查看表結(jié)構(gòu)
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
鵬凌 閱讀(109)
評論(0) 編輯 收藏