mysql SQL语句积累

时间:2024-01-13 06:18:45 

--重命名表

rename table t_softwareport to software_port;

--建立外键

alter table software_port add constraint fk_software_port_softwareprocessid foreign key (softwareprocessid) references software_process (id) on delete restrict on update restrict;

--删除列
alter table software_type drop column upid, drop column orderid;

--修改列名
alter table software_process change software_id softwareid int(11) not null;

--更改列编码

alter table cms_contentbody modify column offical_site_name varchar(30) character set utf8 collate utf8_unicode_ci not null;

--增加列

alter table cms_flash add name varchar(30) not null unique;

标签:SQL语句
0
投稿

猜你喜欢

  • 50个常用sql语句 网上流行的学生选课表的例子

    2024-01-24 10:12:23
  • pytest自动化测试fixture的作用域实例化顺序及可用性

    2022-06-22 14:46:30
  • 解析:怎样在MySQL中获得更好的搜索结果

    2008-11-27 15:19:00
  • mysql 5.6.14主从复制(也称mysql AB复制)环境配置方法

    2024-01-22 07:23:57
  • Vue 中文本内容超出规定行数后展开收起的处理的实现方法

    2024-05-29 22:48:07
  • sqlserver数据库移动数据库路径的脚本示例

    2024-01-28 05:06:49
  • vue多页面项目实现版本快照功能示例详解

    2024-04-28 09:23:25
  • 解决Pytorch 加载训练好的模型 遇到的error问题

    2022-07-21 11:10:45
  • python中wordcloud安装的方法小结

    2022-07-11 04:29:44
  • css网页下拉菜单制作方法(1):基本原理

    2007-02-03 11:39:00
  • python设置Pyplot的动态rc参数、绘图的填充

    2023-12-15 22:52:29
  • python程序的组织结构详解

    2023-06-14 12:23:09
  • Golang实现http重定向https

    2024-04-26 17:27:57
  • python将字典内容存入mysql实例代码

    2024-01-22 11:23:04
  • python线程池threadpool实现篇

    2022-03-21 19:37:34
  • 关于Python的高级数据结构与算法

    2023-12-22 00:29:40
  • Golang学习笔记之安装Go1.15版本(win/linux/macos/docker安装)

    2024-05-13 10:41:23
  • 一文详解MySQL主从同步原理

    2024-01-24 03:00:59
  • 301转向代码合集

    2008-03-20 10:12:00
  • pycharm 无法加载文件activate.ps1的原因分析及解决方法

    2022-07-11 01:00:49
  • asp之家 网络编程 m.aspxhome.com