title: MySQL: How to show all courses available and in another column in which ones a specific user is already enrolled in?
body: <p>I want to show all the courses in the MySQL database, and show in which ones a specific use is enrolled in.</p>
  
  <p>My database structure is like this:</p>
  
  <pre><code>CREATE TABLE usuarios(
      userID int unsigned not null auto_increment primary key,
      userName char(50) null,
  )ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  CREATE TABLE cursos (
      cursoID int unsigned not null auto_increment primary key,
      nombreCurso char(100) not null,
      estadoCurso char(50) not null,
  )ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  CREATE TABLE cursosUsuarios (
      cursosUsuariosID int unsigned not null auto_increment primary key,
      userID int not null,
      cursoID int not null,
      userHabilitado int(1) not null DEFAULT '0',
  )ENGINE=InnoDB DEFAULT CHARSET=utf8;
  </code></pre>
  
  <p>If I do have this information:</p>
  
  <blockquote>
    <p>UserID Alfa is enrolled in cursoID A and B</p>
    
    <p>UserID Beta is enrolled in cursoID A and C</p>
    
    <p>UserID Gamma is enrolled in cursoID C</p>
    
    <p>UserID Delta is enrolled in cursoID D</p>
    
    <p>UserID Epsylon is enrolled in cursoID C and E</p>
  </blockquote>
  
  <p><strong>How can I show a list of all courses but showing in that list what courses does belong user Alfa?</strong>
  Like this:</p>
  
  <blockquote>
    <p>Curso ID ========== User ID</p>
    
    <p>A        ========== Alfa</p>
    
    <p>B        ========== Alfa</p>
    
    <p>C        ========== NULL</p>
    
    <p>D        ========== NULL</p>
    
    <p>E        ========== NULL</p>
  </blockquote>