title: Error 1064 For Data Domain MySQL
body: <p>Creating a data domain for setting a range for the salary and bonus. </p>
  
  <p>Here's the tables:</p>
  
  <pre><code>CREATE TABLE Departments (
  Dept_ID INT (6) NOT NULL,
  Dept_NAME VARCHAR (6) NOT NULL,
  DeptHead_ID INT (6) NULL,
  DeptAA VARCHAR (6), 
  ParentDept_ID INT (4) NULL,
  Location VARCHAR (4) NOT NULL,
  DeptType VARCHAR (6),
  Primary key (Dept_ID)
  );
  
  CREATE TABLE Employee (
  Emp_ID INT (6) NOT NULL,
  Name VARCHAR (6) NOT NULL,
  Dept_ID INT (6) NOT NULL,   
  Tax_ID INT (4) NOT NULL,
  Country VARCHAR (4) NOT NULL,
  Hire_Date DATE,
  Birth_Date DATE,
  Salary INT (6),
  Bonus INT (6),
  AddressInfo VARCHAR (6),  
  Salary INT (6),
  (salary &gt; 0)
  and (mod(salary, 10) = 0) 
  and (bonus =&lt; Salary)
  PRIMARY KEY(Emp_ID)
  FOREIGN KEY(Dept_ID) REFERENCES Departments(Dept_ID)
  );
  ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds 
  to your MySQL server version for the right syntax to 
  use near '(salary &gt; 0) and 
  (mod(salary, 10) =0)
  and (bonus =&lt; Salary),
  PRIMARY KEY(Emp_ID' at line 13
  </code></pre>
  
  <p>Constraint for the data domain and errors:</p>
  
  <pre><code>ALTER TABLE Employee
  ADD CONSTRAINT ck_Employee_Salary_dmn
  CHECK ((salary &gt; 0)
  and 
  (mod(salary, 10) = 0) 
  and 
  (bonus =&lt; Salary)
  );
  
  ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that   corresponds to your MySQL server version for the right syntax to use near '=&lt; Salary))' at   line 7
  </code></pre>
  
  <p>Please let me know if I can provide additional information. </p>