建立数据库,以及表
create database rorely;
use rorely;
create table test(
id int(4) not null unique auto_increment,
name varchar(20) not null,
age int(3) not null,
sex varchar(10)not null,
address varchar(100)
);
insert into test values(null,'Jim',23,'male','wenming cun 23#');
insert into test values(null,'Jim',23,'male','wenming cun 23#');
insert into test values(null,'Jim',23,'male','wenming cun 23#');
insert into test values(null,'Jim',23,'male','wenming cun 23#');
insert into test values(null,'Jim',23,'male','wenming cun 23#');
select * from test;
create database rorely;
use rorely;
create table test(
id int(4) not null unique auto_increment,
name varchar(20) not null,
age int(3) not null,
sex varchar(10)not null,
address varchar(100)
);
insert into test values(null,'Jim',23,'male','wenming cun 23#');
insert into test values(null,'Jim',23,'male','wenming cun 23#');
insert into test values(null,'Jim',23,'male','wenming cun 23#');
insert into test values(null,'Jim',23,'male','wenming cun 23#');
insert into test values(null,'Jim',23,'male','wenming cun 23#');
select * from test;
本文介绍了一个简单的数据库创建过程,包括创建名为rorely的数据库、建立名为test的表,并插入了多条记录。通过SQL语句展示了如何定义字段类型、设置主键自增等基本操作。

被折叠的 条评论
为什么被折叠?



