在 MySQL 中可以使用 SHOW CREATE TABLE 语句来查看表中的约束。
查看数据表中的约束语法格式如下:
例 1
创建数据表 tb_emp8 并指定 id 为主键约束,name 为唯一约束,deptId 为非空约束和外键约束,salary检查约束>0, 然后查看表中的约束,SQL 语句运行结果如下。
desc查看tb_emp8, 如下:
show create table tb_emp8, 如下:
在 MySQL 中可以使用 SHOW CREATE TABLE 语句来查看表中的约束。
查看数据表中的约束语法格式如下:
创建数据表 tb_emp8 并指定 id 为主键约束,name 为唯一约束,deptId 为非空约束和外键约束,salary检查约束>0, 然后查看表中的约束,SQL 语句运行结果如下。
desc查看tb_emp8, 如下:
show create table tb_emp8, 如下:
约束训练
-- 查询外键约束(查某表的所有父表) select c.constraint_name,cc.column_name,rcc.owner,rcc.table_name,rcc.column_namefrom user_constraints c,user_cons_columns cc,user_c
引言有时需要测试网速,但是在开始使用文件传输工具来测量之前,请考虑一下,你实际测量的是什么?为了说明这一点,请假设一位数据库管理员DBA,他一直在使用千兆以太网适配器,在几个节点之间配置集群数据库。事情不太顺利,他自然而然怀疑是硬件出了问题。所以他把你叫过去,告诉你使用sftp在节点之间移动文件时,传输速率与千兆以太网的传输速率极不匹配。他自认为测量了网络吞吐量,但是他可能只是测量了远程系统磁盘的
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M