当前位置:网站首页>mysql数据库的基本操作(三)-——基于字段
mysql数据库的基本操作(三)-——基于字段
2022-07-27 21:59:00 【*黑心萝卜三条杠*】
我们在使用MySQL数据库时,一定离不开数据表的字段,下面就看看小编记录有关字段的基本操作吧。
一.添加字段
alter table + 表名 add + 字段 + 字段类型 + 需要添加的位置;例如:我想在TT_time字段后添加一个tt2字段,那命令及运行结果如下

二.修改字段名字
alter table + 表名 + change + 旧字段名 + 新字段名+新字段类型;例如:我需要将字段tt2名字改成jj3,那我的命令及运行结果如下

三.修改字段类型
alter table + 表名 + modify + 字段名 + 字段类型 + 字段位置;例如:我需要将jj3的类型由int变成char型,那我的命令及运行结果如下

四.删除字段
alter table + 表名 + drop +字段名;例如:我需要删除jj3字段,那我的命令及运行结果如下

边栏推荐
- [meetup preview] openmldb + ONEFLOW: link feature engineering to model training to accelerate machine learning model development
- 元宇宙的应用场景展示
- 永州水质检测实验室建设:家具说明
- NPM related information
- Implement Gobang game with C language
- A great thinking problem cf1671d insert a progression
- 理解双亲委派模式
- Server open sensitive port
- 基本初等函数
- BuildForge 资料
猜你喜欢

『百日百题 · 基础篇』备战面试,坚持刷题 第三话——分支语句!

HarmonyOS 3纯净模式可限制华为应用市场检出的风险应用获取个人数据

The second uncle cured my spiritual internal friction and made me angry out of station B

Oracle密码过期解决办法
Database tuning - principle analysis and JMeter case sharing

MATLAB | 那些你不得不知道的MATLAB小技巧(二)

How difficult is it to apply for a doctorate under the post system in northern Europe?

Cache and MMU management

Impulse attends the 2022 Forum on safe circulation of data elements Online - a special session in the field of government affairs, and helps the construction and innovative development of big data for

JS ATM output
随机推荐
Introduction to thesis writing | how to write an academic research paper
Yongzhou water quality testing laboratory construction: Furniture description
Smart convenience store takes you to unlock the future technology shopping experience
Matlab | matlab terrain generation: rectangular iteration method, inverse Fourier transform method, fractal Berlin noise method
Yongzhou plant cell laboratory construction layout plan
leetcode 452. Minimum Number of Arrows to Burst Balloons 用最少数量的箭引爆气球(中等)
Intel AI practice day issue 56 | explore new trends in industry development
Implement Gobang game with C language
[book club issue 13] packaging format of audio and video files
49 times faster, NVIDIA releases quantum hybrid programming platform qoda
592. 分数加减运算 : 表达式计算入门题
基于Unittest的ddt+yaml实现数据驱动机制
Strong collaboration and common development! Intel and Taiyi IOT held a seminar on AI computing box aggregation services
二舅治好我的精神内耗,也让我火出了B站
Matlab | those matlab tips you have to know (I)
Shell(3)
Yangchuanhui, CTO of oceanbase: some HTAP databases are not real htaps
A great thinking problem cf1671d insert a progression
推进云网融合,筑路数字经济:英特尔亮相第五届数字中国建设峰会-云生态大会
Oracle password expiration solution