赞
回答
收藏
知识点 40 人阅读 | 0 人回复 | 2023-01-19
签到天数: 186 天
[LV.7]常住居民III
5458
5600
2万
管理员
show databases;复制代码
select database();复制代码
create database [ if not exists ] 数据库名 [ default charset 字符集 ]复制代码
create database 数据库名复制代码
create database if not exists 数据库名 复制代码
create database 数据库名 default charset 字符集复制代码
drop database [ if exists ] 数据库名 ;复制代码
use 数据库名 ;复制代码
create table 表名( 1 V8 N. n/ r2 } l9 J字段1 字段1类型 [comment 字段1注释 ], 字段2 字段2类型 [comment 字段2注释 ], % H' U6 v% Y# V# u, U5 C字段3 字段3类型 [comment 字段3注释 ], ' z* Y& ~, x& L1 Q...... 2 n& {2 ^0 h, y8 _1 O字段n 字段n类型 [comment 字段n注释 ] + c! `$ d. _7 L4 M9 A/ `. ?; g7 c0 v) [ comment 表注释 ] ; 复制代码
show tables;复制代码
desc 表名 ;复制代码
show create table 表名 ;复制代码
alter table 表名 add 字段名 类型 (长度) [ comment 注释 ] [ 约束 ];复制代码
alter table 表名 modify 字段名 新数据类型 (长度); 复制代码
alter table 表名 change 旧字段名 新字段名 类型 (长度) [ comment 注释 ] [ 约束 ]; , J' c$ L# M# n+ ?0 M# n3 O. r7 r3 N; O复制代码
alter table 表名 drop 字段名; 复制代码
alter table 表名 rename to 新表名; 0 T6 g$ f# ?% W复制代码
drop table [ if exists ] 表名; 6 i; u" A; t! F复制代码
truncate table 表名; 复制代码
使用道具 举报
本版积分规则 发表回复 回帖后跳转到最后一页
java8
发表主题 5458
java8 2023-02-02