主页 M

mysql表操作sql,常用语句

2023-03-01 网页编程网 网页编程网

1.表setting_project中指定位置后projectFull增加某个字段shipLabelHead

alter table setting_project add shipLabelHead varchar(64) NULL after projectFull;

2.创建数据库mydb

CREATE DATABASE IF NOT EXISTS mydb DEFAULT CHARACTER SET utf8;

3.创建数据表list

CREATE TABLE IF NOT EXISTS list (
id int(8) NOT NULL AUTO_INCREMENT,
type int(4) NOT NULL DEFAULT 0,
click int(8) NOT NULL DEFAULT 0,
title char(64) NOT NULL DEFAULT '',
isHidden smallint(1) NOT NULL DEFAULT 0,
isSticky smallint(1) NOT NULL DEFAULT 0,
tag varchar(128) NOT NULL,
others varchar(32),
input timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY(id),
KEY mainindex (type)
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
阅读原文
阅读 1544
123 显示电脑版