当前位置:网站首页>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字段,那我的命令及运行结果如下

边栏推荐
- HarmonyOS 3纯净模式可限制华为应用市场检出的风险应用获取个人数据
- Understand the parental delegation model
- MATLAB | 那些你不得不知道的MATLAB小技巧(一)
- It was dog days, but I was scared out of a cold sweat: how far is the hidden danger of driving safety from us?
- 阿金的思考
- Microsoft Amazon layoffs, the economic crisis is getting closer...
- MATLAB | MATLAB地形生成:矩形迭代法 · 傅里叶逆变换法 · 分形柏林噪声法
- The latest ijcai2022 tutorial of "figure neural network: foundation, frontier and application"
- 北欧岗位制博士申请有多难?
- Jin's thinking
猜你喜欢

论文写作全攻略|一篇学术科研论文该怎么写

Matlab | those matlab tips you have to know (3)

好漂亮的彩虹

学yolo需要什么基础?怎么学YOLO?

Intel AI practice day issue 56 | explore new trends in industry development

LeetCode 415. 字符串相加 和 43. 字符串相乘

2022年中国网络视频市场年度综合分析

What has the metauniverse of more than 30 years brought to us?

千万播放竟有通用公式?B站被小看的爆款机会!

MFC prompts that this application has requested the runtime to terminate it in an unused way editbox box has been deleted and is still in use
随机推荐
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
Those "experiences and traps" in the data center
Smart convenience store takes you to unlock the future technology shopping experience
【Meetup预告】OpenMLDB+OneFlow:链接特征工程到模型训练,加速机器学习模型开发
数据中台的那些“经验与陷阱”
Tiktok live broadcast monitoring - round robin 24 hours - live broadcast barrage
How does matlab set the K-line diagram to classic red and green color matching?
Is it amazing to extract text from pictures? Try three steps to realize OCR!
Intel releases open source AI Reference Suite
C语言实现五子棋游戏
《数字经济 科技向善》大咖对谈干货来啦
英特尔携手汉朔、微软,释放“AI + 零售”大招!
AI briefing how to use loss surfaces a model integration
泵站远程监控
论文写作全攻略|一篇学术科研论文该怎么写
自动推理的逻辑07–谓词演算
Precautions for site selection of Yongzhou clean animal laboratory
OpenVINO整合TensorFlow实现推理加速
leetcode 452. Minimum Number of Arrows to Burst Balloons 用最少数量的箭引爆气球(中等)
Oracle密码过期解决办法