mysql -uroot -p1270mysql
show databases;
use mysql
show tables;
select * from time_zone;
exit;
create database test;
create table pet
(name VARCHAR(20), owner VARCHAR(20), species VARCHAR(20), sex char(1), birth DATE, death DATE);
describe pet;
desc pet;
增
insert into pet values('Puffball', 'Diane', 'hamster', 'f', '1993-03-30', NULL);
insert into pet values('Buffy','Harold', 'snake', 'f', '1999-02-04', NULL);
insert into pet values('Fang','Benny', 'dog', 'm', '1999-05-13', NULL);
insert into pet values('Bowser', 'Diane', 'dog', 'f', '1999-08-27', 2000-07-09);
insert into pet values('Chirpy', 'Gwen', 'bird', 'f', '1999-00-11', NULL);
insert into pet values('Slim', 'Benny', 'bird', 'm', '1999-12-09', NULL);
insert into pet values('Claw', 'Gwen', 'cat', 'm', '1999-03-17', NULL);
删改查
delete from pet where name='Claw’;
update pet set name='旺财' where owener='Mr.zhou’;select * from pet;
create table user(id int primary key, name varchar(20));
网友评论