title: Can anyone help me with this SQLite 3 Python Operational Error?
body: <p>I am trying to create a database program using SQLite3 and Tkinter. It is for my Computer Science A-Level Course. I am getting this error whenever I try to run the following code:</p>
  <blockquote>
  <p>Exception has occurred: OperationalError
  near &quot;BranchID&quot;: syntax error
  File &quot;\Code\tables.py&quot;, line 14, in 
  cursor.execute('''</p>
  </blockquote>
  <pre class="lang-py prettyprint-override"><code>import sqlite3
  with sqlite3.connect(&quot;LeeOpt.db&quot;) as db:
      cursor = db.cursor()
  
  cursor.execute('''
  CREATE TABLE IF NOT EXISTS Branches(
  BranchID INTEGER PRIMARY KEY,
  Town VARCHAR(30) NOT NULL,
  Postcode VARCHAR(8) NOT NULL,
  Email VARCHAR(30) NOT NULL,
  Telephone VARCHAR(15) NOT NULL);
  ''')
  
  cursor.execute('''
  CREATE TABLE IF NOT EXISTS Customer(
  CustomerID INTEGER PRIMARY KEY,
  BranchID INTEGER NOT NULL,
  Name VARCHAR(20) NOT NULL,
  Surname VARCHAR(30) NOT NULL,
  DateOfBirth NOT NULL,
  Town VARCHAR(30) NOT NULL,
  Postcode VARCHAR(7) NOT NULL,
  EmailAddress VARCHAR(30) NOT NULL,
  TelephoneNo VARCHAR(12) NOT NULL,
  MedicalConditions TEXT,
  FOREIGN KEY BranchID REFERENCES Branches(BranchID));
  ''')
  </code></pre>
  <p>I am struggling to understand what has went wrong. Could anyone help me solve this problem? Thanks.</p>