(2.10)Mysql之SQL基础——约束及主键重复处理 关键词:mysql约束,批量插入数据主键冲突 [1]查看索引: show index from table_name; [2]查看有约束的列:select * from information_schema.key_column_usage where table_schema= 'db_name' and table_name = 'table_name'; [3]查看有约束的表及表约束类型:select * from informat…
本文只列出索引,触发器,视图的简单操作语句 1.索引 a.创建 create index idx_name on fdh_client_info(name); --普通索引(单列索引) create unique index uni_idx_id on fdh_client(id); --唯一索引 create index union_idx_name_addr on fdh_client(name, address); --联合索引 b.查询索引 select * from user_inde…
SQL基础随记1 SQL分类 常用函数 ALL ANY EXISTS IN 约束 其实这里知识不难,只是好久不接触突然被问的话有时还真的一时答不上,自己写一遍胜过盲扫.当然,也有些常读常新的地方会记录下来. 对SQL语言进行划分 DDL --- Data Definition Language --- 定义 --- 增删改数据库和表的结构 DML --- Data Manipulation Language --- 操作 --- 对记录增删改 DQL --- Data Quary Lan…
(2.9)Mysql之SQL基础——索引的查看与删除 关键词:mysql索引查看,mysql索引删除 1.索引查询(以下包括主键,唯一,普通,复合,全文,但不包括外键) (1)按库查询 select * from information_schema.statistics where table_schema='test'; (2)按表查询 select * from information_schema.statistics where table_schema='test' and tabl…