• mysql-索引


    创建test表

    create table test(
    id int,
    name varchar(10) not null,
    age int default 18,
    passwd varchar(12),
    article text
    );

    主键索引

    alter table test add primary key auto_increment (id);

    唯一索引

    alter table test add unique (name);       (可同时添加多个字段)

    普通索引

    alter table test add index (age);  (可同时添加多个字段)

    全文索引

    alter table test add fulltext (article);

    mysql> show create table testG
    *************************** 1. row ***************************
           Table: test
    Create Table: CREATE TABLE `test` (
      `id` int(11) NOT NULL,
      `name` varchar(10) NOT NULL,
      `age` int(11) DEFAULT '18',
      `passwd` varchar(12) DEFAULT NULL,
      `article` text,
      PRIMARY KEY (`id`),
      UNIQUE KEY `name` (`name`),
      KEY `age` (`age`),
      FULLTEXT KEY `article` (`article`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8
    1 row in set (0.00 sec)
  • 相关阅读:
    第九周作业
    第八周
    第七周
    Jmeter连接到Mysql
    数据库常用链接URL写法
    功能测试方法
    常建输入框的测试
    系统业务流程测试(转)
    Linux
    搭建Git服务器
  • 原文地址:https://www.cnblogs.com/tangpg/p/8724025.html
Copyright © 2020-2023  润新知