针对score列进行索引
ALTER TABLE studentsADD INDEX idx_score (score);
添加唯一索引:
ALTER TABLE studentsADD UNIQUE INDEX uni_name (name);
添加唯一约束:
ALTER TABLE studentsADD CONSTRAINT uni_name UNIQUE (name);
Sign in to make a reply
有志者事竟成
针对score列进行索引
ALTER TABLE studentsADD INDEX idx_score (score);
添加唯一索引:
ALTER TABLE studentsADD UNIQUE INDEX uni_name (name);
添加唯一约束:
ALTER TABLE studentsADD CONSTRAINT uni_name UNIQUE (name);