常用sql整理

1. 表增加字段

alter table pet add des char(100) null;

2. 创建表

CREATE TABLE `cjj` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(250) NOT NULL DEFAULT '',
  `sex` tinyint(1) NOT NULL DEFAULT '1',
  `age` tinyint(3) NOT NULL DEFAULT '18',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

猜你喜欢

转载自www.cnblogs.com/cjjjj/p/10112480.html