sql example 1 – create
sql example 1 – create
- database 操作
create dateabase test; use test;
show databases; show create database test; drop database test;
create database if not exists test; drop database test;
create database if not exists test character set gbk; alter database test character set utf8;
- table 操作
use test; create table user1 ( id int not null, username varchar(20) not null );
show tables; desc user1; show columns from user1; select * from user1;
show create table user1; drop table user1;
create table user1 ( id int(11) NOT NULL, username varchar(20) NOT NULL ) ENGINE=InnoDB default charset=gtk; show create table user1; alter table user1 character set utf8;
时间: 2024-12-15 13:55:06