标签:mys 语句 order har rename phone creat try alt
CREATE TABLE R (
A1<数据类型>,
A1<数据类型>,
...
An<数据类型>
);
CREATE TABLE vendors
(
vend_id int NOT NULL AUTO_INCREMENT,
vend_name char(50) NOT NULL,
vend_state char(5) NULL,
vend_country char(50) NULL DEFAULT ‘China‘
,PRIMARY KEY (vend_id)
) ENGINE=InnoDB;
ALTER TABLE R 具体的更改操作;
//添加列
ALTER TABLE vendors
ADD vend_phone CHAR(20);
//删除列
ALTER TABLE vendors
DROP COLUMN vend_phone;
//添加外键
ALTER TABLE orderitems
ADD CONSTRAINT fk_orderitems_orders
FOREIGN KEY (order_num) REFERENCES orders (order_num);
DROP TABLE R;
RENAME TABLE R1 TO R2;
CREATE VIEW <视图名> AS <子查询>;
标签:mys 语句 order har rename phone creat try alt
原文地址:http://www.cnblogs.com/deng-cc/p/7977883.html