title: Error Code: 1822. Failed to add the foreign key constraint. Missing index for constraint 'questions_ibfk_1' in the referenced table 'category'
body: <p>cannot add foreign key constraint to table</p>
  
  <pre><code>create table users
  (
  user_id int  auto_increment  primary key  not null,
  username varchar(50)    unique null ,
  email varchar(50)   unique  ,
  passwords varchar(50) not null,
  login_status boolean not null  
  );
  
  create table category (
   category_id int  primary key not  null,
   category_name varchar(50) not null
   );
  
   create table answers (
  id_answer int  auto_increment  primary key not null,
  answer boolean  not null
  );
  
  create table questions  ( 
  question_id int primary key not null,
   category_name varchar(50) not null,
  content varchar(50) not null ,
   foreign key (category_name) references category (category_name)
   );
  </code></pre>