1.创建一个test数据库
create database test;
2.使用数据库
use test;
3.创建三个数据表
create table if not exists t_account (
id int(11) primary key not null ,
account_name varchar(20) not null comment '管理员名称',
account_passwd varchar(50) not null comment '管理员密码',
tel varchar(50) not null comment '管理员电话号码' ,
true_name varchar(50) not null comment '管理员姓名'
)charset=utf8;
create table if not exists student(
id int(11) primary key not null,
sno int(11) not null comment '学生学号',
stu_name varchar(50) not null comment '学生姓名',
stu_sex char(10) not null comment '学生性别',
stu_birthday date not null comment '学生出生日期',
stu_address varchar(100) not null comment '学生地址'
)charset=utf8;
create table if not exists score(
id int(11) primary key not null,
course_name varchar(50) not null comment '课程名称',
stu_score int(11) not null comment '学生成绩'
)charset=utf8;
4.执行三个数据表id自动递增
alter table t_account change column id id int(11) not null auto_increment first;
alter table student change column id id int(11) not null auto_increment first;
alter table score change column id id int(11) not null auto_increment first;
5.查看表结构
desc t_account;
6.插入数据值
insert into t_account (account_name,account_passwd,tel,true_name) values
('admin','123456','13666888333', '李经理'),
('test','123456','13666333444','测试员');