create index indx_empno on employee_info(empno); --一般索引 create index indx_1 on employee_info(empno,deptno); --复合索引
索引:create index iempno on employee_info(empno); 复合索引:create index iempno_deptno on employee_info(empno,deptno);
为什么唯一索引这样创建呢? alter table employee_info add constraint uq_address unique(address)???
如果当初创建表了,但没有创建唯一的索引就应该是这样创建。 alter table employee_info add constraint uq_address unique(address)
一般理解单个的字段创建索引是普通索引,如果是某个表中创建的多个字段联合索引就是复合索引。 create index empno on employee_info(empno)---普通的索引 create index iempno_deptno on employee_info(empno,deptno);--符合索引。
create index indx_empno on employee_info(empno); --一般索引
create index indx_1 on employee_info(empno,deptno); --复合索引
复合索引:create index iempno_deptno on employee_info(empno,deptno);
alter table employee_info add constraint uq_address unique(address)???
alter table employee_info add constraint uq_address unique(address)
create index empno on employee_info(empno)---普通的索引
create index iempno_deptno on employee_info(empno,deptno);--符合索引。