想看下某模式下所有表创建的分布键是否合理,查找系统表文档拼出如下sql,亲们如果有更好的sql或者意见欢迎留言! SELECT aaa.nspname AS "模式名", aaa.relname AS "表名", aaa.table_comment AS "中文表明", ccc.attname AS "分布键" FROM ( SELECT aa.
命令 show create table game; game是表名 在web管理中,请在sql标签中查,不要在query中执行. show create table game; === <Result of SELECT Command in Line 1> === TABLE CREATE TABLE ============================================ 'game' 'CREATE TABLE game ( host_year INTEGER NOT
如下面的: create table applicant (id int not null auto_increment primary key, jobId int not null, studentId int not null, foreign key (studentId) references student(id), foreign key (jobId) references job(id) ); foreign key 后面要有(),有多个列则(index1,index2). (
1,主键的删除 ALTER TABLE TABLENAME DROP PRIMARY_KEY 运行上面的SQL能够删除主键:假设不成功能够用 ALTER TABLE TABLENAME DROP CONSTRAINTS COLUMN CASCADE; --删除约束 ALTER TABLE TABLENAME DISABLE PRIMARY_COLUMN ; --设置被设置为主键的列为无效 DROP INDEX INDEX_NAME; --删除主键索引 2,查看主键约束 SELECT * FRO