title: MySql textbook syntax wrong?
body: <p>I have 3 tables: Employee(EmpCode,EmpName,Birth,DeptCode)
  Dept(DeptCode, DeptName, Location, Telephone)
  Project(PrCode,PrName, Budget)
  Participate(EmpCode,PrCode, Hours).</p>
  
  <p>I want to find the employees who participate in all projects. My textbook uses this query to find the EmpCode of employees working in both Project 1 and Project2: <code>select EmpCode from Participate group by EmpCode having set(PrCode) contains('Pr1','Pr2')</code> </p>
  
  <p>Using this, I made a query to find the employees participating in all projects:</p>
  
  <pre><code>select EmpName,Birth, DeptCode
  from Employee
  where EmpCode in (
      select EmpCode as Employee_Code,DeptCode
      from Participate
      group by DeptCode
      having set(Employee_Code) contains EmpCode );
  </code></pre>
  
  <p>But it gives me a syntax error! Please help me thank you very much.
  P/S: This is the full code:</p>
  
  <pre><code>create table Employee(
  EmpCode int unsigned not null auto_increment,
  EmpName varchar(40) not null default '',
  Birth varchar(40) not null default '',
  DeptCode int unsigned not null default 0,
  primary key (EmpCode)
  );
  
  create table Dept(
  DeptCode int unsigned not null auto_increment,
  DeptName varchar(40) not null default '',
  Location varchar(40) not null default '',
  Tel varchar(40) not null default '',
  primary key (DeptCode)
  );
  
  create table Project(
  PrCode int unsigned not null auto_increment,
  PrName varchar(40) not null default '',
  Budget varchar(40) not null default '',
  primary key (PrCode)
  );
  
  create table Participate(
  EmpCode int unsigned not null ,
  DeptCode int unsigned not null ,
  Hours int unsigned not null default 0,
  primary key (EmpCode, DeptCode)
  );
  
  
  insert into Employee values 
  (501,'Nguyen Van A', '26/03/1974',301),
  (502,'Pham Thi B', '10/01/1990',302),
  (503,'abcdsfdsf', '06/06/1991',302),
  (570,'Tran Minh T', '25/02/1985',303);
  
  insert into Dept values
  (301,'HR','Bi mat','029393943'),
  (302,'R&amp;D','Quan net','01938228329'),
  (303,'PR','Everywhere','024032940');
  
  insert into Project values
  (201,'on linear programming','1 trieu'),
  (203,'military secret','1 ty ty'),
  (204,'Skynet','1 ty USD'),
  (210,'Terminator','100 trieu');
  
  insert into Participate values
  (501, 201, 1000),
  (501, 203, 2000),
  (502, 204, 10),
  (503, 210, 220),
  (501, 204, 7474),
  (501, 210, 103),
  (570, 204, 11);
  
  alter table Participate
      add foreign key (EmpCode) references Employee(EmpCode),
      add foreign key (PrCode) references Project(PrCode);
  
  alter table Employee
      add foreign key (DeptCode) references Dept(DeptCode);
  
  select EmpName,Birth, DeptCode
      from Employee
      where EmpCode in (
          select EmpCode as Employee_Code,DeptCode
          from Participate
          group by DeptCode
          having set(Employee_Code) contains EmpCode );
  </code></pre>