当前位置:网站首页>MySQL advanced (thirty-three) MySQL data table adding fields
MySQL advanced (thirty-three) MySQL data table adding fields
2022-08-10 14:24:00 【InfoQ】
一、在末尾添加字段
ALTER TABLE <表名> ADD <新字段名><数据类型>[约束条件];
- <表名> 为数据表的名字;
- <新字段名> 为所要添加的字段的名字;
- <数据类型> 为所要添加的字段能存储数据的数据类型;
- [约束条件] 是可选的,用来对添加的字段进行约束.
USE test;CREATE TABLE student (
id INT(4),
name VARCHAR(20),
sex CHAR(1));
ALTER TABLEALTER TABLE student ADD age INT(4);DESC student;二、在开头添加字段
ALTER TABLE <表名> ADD <新字段名> <数据类型> [约束条件] FIRST;
ALTER TABLEALTER TABLE student ADD stuId INT(4) FIRST;DESC student;三、在中间位置添加字段
ALTER TABLE <表名> ADD <新字段名> <数据类型> [约束条件] AFTER <已经存在的字段名>;
ALTER TABLE student ADD stuno INT(11) AFTER name;DESC student;边栏推荐
猜你喜欢

C#实现访问OPC UA服务器

【ECCV 2022|Millions of Prizes】PSG Competition: Pursuing the "Most Comprehensive" Scene Understanding

Open source SPL wipes out tens of thousands of database intermediate tables

win2012安装Oraclerac失败

注意力模型---Attention Model
![[target detection] small script: extract training set images and labels and update the index](/img/9d/0f88b484cee1b85df6bc1153d9b6b4.png)
[target detection] small script: extract training set images and labels and update the index

关于已拦截跨源请求CORS 头缺少 ‘Access-Control-Allow-Origin‘问题解决

awk的简单使用
雨水中存在的PFAS化学物质对饮用水安全构成了威胁

实现一个深克隆
随机推荐
Do not access Object.prototype method ‘hasOwnProperty‘ from target object....
In the second half of 2012 system architecture designers afternoon paper II
【Gazebo入门教程】第三讲 SDF文件的静/动态编程建模
Short read or OOM loading DB. Unrecoverable error, aborting now
recursive recursive function
图式图例规范尺寸
每个月工资表在数据库如何存储?求一个设计思路
数据产品经理那点事儿 一
强意识 压责任 安全培训筑牢生产屏障
汉字检测和关键词检测
镜像瘦身:每一层都不能放过
leetcode 739. Daily Temperatures 每日温度(中等)
Error: Rule can only have one resource source (provided resource and test + include + exclude)
微信扫码登陆(1)—扫码登录流程讲解、获取授权登陆二维码
静态变量存储在哪个区
A can make large data clustering method of 2000 times faster, don't poke
锂电池技术
Stream通过findFirst()查找满足条件的一条数据
开源SPL消灭数以万计的数据库中间表
The recursive recursive Fighting_ silver study ah but level 4