网站开发 认证,网页设计策划书,网站建设什么,海南疾控发布问卷调查目录 一、创建mysql表的结构
1.在mydb数据库下创建一个表格名字为stu_info#xff0c;里面结构包含了学号和姓名的名称#xff0c;字符型以及他的引擎为innodb 字符集为gbk 校队规则为gbk_chinese_ci
二、数据库表查看的基本用法语句
1.查看数据库表明
2.查看数据库表的结…目录 一、创建mysql表的结构
1.在mydb数据库下创建一个表格名字为stu_info里面结构包含了学号和姓名的名称字符型以及他的引擎为innodb 字符集为gbk 校队规则为gbk_chinese_ci
二、数据库表查看的基本用法语句
1.查看数据库表明
2.查看数据库表的结构
3.删除stu_info表
4.再次删除stu_info表不出现报错并且查看告警信息
三、对数据库表中数据进行操作
1.在表中数据增加一行数据结构并检验
2.修改表中gender数据的字符类型并检验
3.删出数据库表中gender这一结构的数据并检验
4.修改数据库表明mydb.stu_info为mydb.stu_information,并检验
5.将数据库表中结构的stu_num修改为stu_id并检验
四、数据库表的结构复制和数据的复制
1.在mydb.stu_info中插入一条数据并检验
2.复制stu_info的数据库表结构名字为stu_info2,并检验
3.复制数据库stu_info的整体结构和数据名字为stu_info3并检验
一、创建mysql表的结构
1.在mydb数据库下创建一个表格名字为stu_info里面结构包含了学号和姓名的名称字符型以及他的引擎为innodb 字符集为gbk 校队规则为gbk_chinese_ci create table mydb.stu_info( stu_num int comment 学号, stu_name varchar(30) comment 姓名 ) engine innodb character gbk collate gbk_chinese_ci; 二、数据库表查看的基本用法语句
1.查看数据库表明 show tables; 2.查看数据库表的结构 desc stu_info; 3.删除stu_info表 drop table stu_info; 4.再次删除stu_info表不出现报错并且查看告警信息 drop table if exists stu_info; show warnings; 三、对数据库表中数据进行操作
1.在表中数据增加一行数据结构并检验 alter table mydb.stu_info add gender char(1) comment 性别; desc stu_info; 2.修改表中gender数据的字符类型并检验 alter table mydb.stu_info modify gender enum (m,f); desc stu_info; 3.删出数据库表中gender这一结构的数据并检验 alter table mydb.stu_info drop gender; desc stu_info; 4.修改数据库表明mydb.stu_info为mydb.stu_information,并检验 alter table mydb.stu_info rename mydb.information; show tables; 5.将数据库表中结构的stu_num修改为stu_id并检验 alter table mydb.stu_info change stu_num stu_id int comment 学号; desc stu_info; 四、数据库表的结构复制和数据的复制
1.在mydb.stu_info中插入一条数据并检验 insert into stu_info values(1001,李四); select * from stu_info; 2.复制stu_info的数据库表结构名字为stu_info2,并检验 create table stu_info2 like stu_info; show tables; desc stu_info2; select * from stu_info2; 3.复制数据库stu_info的整体结构和数据名字为stu_info3并检验 create table stu_info3 select * from stu_info; show tables; desc stu_info3; select * from stu_info3;