title: How to best categorize values in a table
body: <p>I'm in the process of designing a new database for a project at work. I want to create a table that stores Assignments for a digital classroom. Each Assignment can be one of 2 categories: <em>"Individual"</em> or <em>"Group"</em>.</p>
  
  <p>The first implementation that comes to mind is the following:</p>
  
  <pre><code>CREATE TABLE `assignments` (
    `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
    `title` varchar(255) DEFAULT NULL,
    `category` varchar(10) NOT NULL DEFAULT 'individual',
    PRIMARY KEY (`id`),
    KEY `category_index` (`category`(10))
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  </code></pre>
  
  <p>I would then select all assignments of a given category with:</p>
  
  <pre><code>SELECT title FROM assignments WHERE category = "individual"
  </code></pre>
  
  <p>However, because we've had performance issues in the past, I'm trying to optimize the design as much as possible. As such, I'm wondering whether or not storing the <code>category</code> as a <code>VARCHAR</code> is a good idea (considering the table will get quite large)? Would indexing an <code>INT</code> perform better over a <code>VARCHAR</code>?</p>
  
  <p>Aside from just performance, I'm also curious what would be considered a good solution from a design-perspective. Suggestions?</p>