当前位置:网站首页>MySQL field modification
MySQL field modification
2022-07-23 17:48:00 【Ideal coder】
// Primary key 549830479
alter table tabelname add new_field_id int(5) unsigned default 0 not null auto_increment ,add primary key (new_field_id);
// Add a new column 549830479
alter table t2 add d timestamp; alter table infos add ex tinyint not null default '0';
// Delete column 549830479
alter table t2 drop column c;
// To be ranked high 549830479
alter table t1 change a b integer;
// Change the type of the column 549830479
alter table t1 change b b bigint not null; alter table infos change list list tinyint not null default '0';
// rename table 549830479
alter table t1 rename t2;
Suo Yin 549830479
mysql> alter table tablename change depno depno int(5) not null; mysql> alter table tablename add index Index name ( Field name 1[, Field name 2 …]); mysql> alter table tablename add index emp_name (name);
Index with primary key 549830479
mysql> alter table tablename add primary key(id);
Index with unique restrictions 549830479
mysql> alter table tablename add unique emp_name2(cardnumber);
Delete an index 549830479
mysql>alter table tablename drop index emp_name;
Modify table :549830479
Add fields :549830479
mysql> ALTER TABLE table_name ADD field_name field_type;
Modify the original field name and type :549830479
mysql> ALTER TABLE table_name CHANGE old_field_name new_field_name field_type;
Delete field :549830479
mysql> ALTER TABLE table_name DROP field_name; Link to the original text :http://www.blogjava.net/Alpha/archive/2007/07/23/131912.html
边栏推荐
- Do you really understand the persistence mechanism of redis?
- el-input使用
- New opportunities for cultural tourism in the era of digital intelligence? China Mobile Migu creates "the first island in the yuan universe"
- Transfer business append log (transaction propagation behavior)
- Literature learning (part100) -- an introduction to autoencoders
- Kubernetes kubelet hard core knowledge architecture
- The use method of quota command is expanded in detail, and the carrying method of quota command in RHEL 7! Disk capacity quota!
- True title of Blue Bridge Cup: Card [easy to understand]
- Thread pool, who am I? Where am I?
- At least half of the people can't answer the difference between isempty and isblank
猜你喜欢

Food safety | ham sausage lunch meat, is it really so unbearable?

训练和测试的loss不下降,并且精度超低

Differences between nvisual generic cabling management software and network management software

ContextLoaderListener vs DispatcherServlet
A series of specifications of oneplus 10t were disclosed before the product was released

Do you really understand the persistence mechanism of redis?

TYPE-C 转OTG(USB2.0传输数据)+PD充电协议芯片 乐得瑞LDR6028/LDR6023SS
![[introduction series of redis] data types and related commands of redis](/img/de/7322362f4a27acd264c29f325e45a2.png)
[introduction series of redis] data types and related commands of redis

转账业务追加日志(事务的传播行为).

Why do you get confused when you ask JVM???
随机推荐
"Now, the number of codes has expanded to astronomical level"
curl get&post
Food safety | attention to smoking food, do you know this knowledge
SAP HANA数据库备份失败解决办法
phpstrom快捷键
李宏毅《机器学习》丨7. Conclusion(总结)
Kubernetes kubelet manages pod core process
js工具 cecp
Research and implementation of network multi exit design based on policy routing deployment
一台Linux机器上启动多个redis实例
keyup.native在el-input中的使用
Start multiple redis instances on a Linux machine
At least half of the people can't answer the difference between isempty and isblank
日期格式化
工业物联网中的时序数据
Kv260 single board PS control setting IIC switch chip
非继承多态思路配合typeid实现不同参数的传递
[operation] Yan Yi (Internet new technology operation)
59. General knowledge of lightning safety
Mysql操作