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

边栏推荐
- threejs个人笔记
- In the third week of July, the list of feigua data station B up main ranking list was released!
- JS 事件传播 捕获阶段 冒泡阶段 onclick addEventListener
- Is it amazing to extract text from pictures? Try three steps to realize OCR!
- [meetup preview] openmldb + ONEFLOW: link feature engineering to model training to accelerate machine learning model development
- The R language uses the hexsticker package to convert the visualized results of ggplot2 package into hexagonal diagrams (hexagonal stickers, hexagonal stickers, ggplot2 plot to hex stickers)
- mysql分表之后怎么平滑上线?
- Matlab | those matlab tips you have to know (I)
- 很棒的一个思维题CF1671D Insert a Progression
- 【Meetup预告】OpenMLDB+OneFlow:链接特征工程到模型训练,加速机器学习模型开发
猜你喜欢

英特尔AI实践日第56期 | 探讨行业发展新趋势

A few lines of code can easily realize the real-time reasoning of paddleocr. Come and get!

Window function over

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

require、loadfile、dofile、load、loadstring

英特尔携手汉朔、微软,释放“AI + 零售”大招!

҈ straight ҈ Broadcast ҈ Pre ҈ Report ҈ |҈ In hot summer, let's cross the high temperature and "bake" with nono!

Intel joins hands with hanshuo and Microsoft to release the "Ai + retail" trick!

【Leetcode】547.省份数量(中等)

Intel AI practice day issue 56 | explore new trends in industry development
随机推荐
MATLAB如何将k线图设置为经典红绿配色?
阿金的思考
Shell(3)
MATLAB | MATLAB地形生成:矩形迭代法 · 傅里叶逆变换法 · 分形柏林噪声法
基本初等函数
HarmonyOS 3纯净模式可限制华为应用市场检出的风险应用获取个人数据
JS 事件传播 捕获阶段 冒泡阶段 onclick addEventListener
y79.第四章 Prometheus大厂监控体系及实战 -- prometheus的服务发现机制(十)
A design scheme of Wal
numpy没有unsqueeze函数
7月第3周榜单丨飞瓜数据B站UP主排行榜发布!
Oracle password expiration solution
「图神经网络:基础、前沿与应用」最新IJCAI2022教程
服务器开放敏感端口
Server open sensitive port
Glory launched a number of products at the same time. The price of notebook magicbook V 14 starts from 6199 yuan
Microsoft Amazon layoffs, the economic crisis is getting closer...
渲染问题
MATLAB | 那些你不得不知道的MATLAB小技巧(四)
MySQL limit使用及超大分页问题解决