title: Defining a Foreign key constraint in H2 Databases
body: <p>I am new in coding so I made a tables in SQL server and it worked, so i used the same command in H2 and it said I have  a syntax problems with the second table, someone can help?</p>
  
  <pre><code>CREATE TABLE TOURISTINFO(
  TOURISTINFO_ID INT PRIMARY KEY,
  NAME VARCHAR(25) NOT NULL,
  NATIONALITY VARCHAR(15) NOT NULL
  )
  
  CREATE TABLE PLANETICKETS(
  DESTINATION VARCHAR(10) NOT NULL,
  TICKETPRICE NUMERIC(8,2) NOT NULL,
  TOURISTINFO_ID INT FOREIGN KEY REFERENCES TOURISTINFO
  )
  </code></pre>
  
  <p>The error is</p>
  
  <pre><code>Syntax error in SQL statement "CREATE TABLE PLANETICKETS( 
  DESTINATION VARCHAR(10) NOT NULL, 
  TICKETPRICE NUMERIC(8,2) NOT NULL, 
  TOURISTINFO_ID INT FOREIGN[*] KEY REFERENCES TOURISTINFO 
  )"; expected "(, FOR, UNSIGNED, NOT, NULL, AS, DEFAULT, GENERATED, NOT, NULL, AUTO_INCREMENT, BIGSERIAL, SERIAL, IDENTITY, NULL_TO_DEFAULT, SEQUENCE, SELECTIVITY, COMMENT, CONSTRAINT, PRIMARY, UNIQUE, NOT, NULL, CHECK, REFERENCES, ,, )"; SQL statement:
  CREATE TABLE PLANETICKETS( 
  DESTINATION VARCHAR(10) NOT NULL, 
  TICKETPRICE NUMERIC(8,2) NOT NULL, 
  TOURISTINFO_ID INT FOREIGN KEY REFERENCES TOURISTINFO 
  ) [42001-173] 42001/42001
  </code></pre>