0
点赞
收藏
分享

微信扫一扫

《昇思25天学习打卡营第02天|qingyun201003》

第一题

输入密码登录mysql,创建数据库zoo,转换到zoo数据库,

mysql> create database zoo character set gbk;
mysql> use zoo

请添加图片描述

查看创建数据库zoo信息

mysql> show create database zoo;

请添加图片描述

删除数据库zoo

mysql> drop database zoo

请添加图片描述

第二题

先创建数据库db_system,接着创建两张表

create table user(
id int primary key auto_increment comment 'id',
NAME char(20) not null comment '姓名',
gender char(4) not null comment '性别',
birthday date comment '生日',
entry_date date not null comment '入职时间',
job char(30) not null comment '职位');

请添加图片描述

>create table salary(
->id int primary key auto increment comment'id',
->userld int not null comment'用户id',
->basesalary float not null comment'基本工资',
->month int not null comment'月份',
->allowances float not null default 0 comment'补贴');

请添加图片描述

第三题

alter的基本命令,add、modify、drop、rename、change…

1、

mysql>alter table user add image tinyblob

请添加图片描述

2、

mysql> alter table user modify job varchar(60);

请添加图片描述

3、

mysql> alter table user drop column gender;

请添加图片描述

4、

mysal> alter table salary rename usersalary

请添加图片描述

5、

mysql> alter table user convert to character set utf8.

请添加图片描述

6、

mysql> alter table user change column name username char(20) not null,

请添加图片描述

举报

相关推荐

0 条评论