title: Is there always a need for a Primary Key in sql table creations?
body: <p>I don't know if I created these tables in sql correctly. Can someone confirm I am doing this correctly or incorrectly? Can a table just have a foreign key or does it have to have a primary key? Thanks in advance.</p>
  
  <pre><code>CREATE TABLE Job(
  JobId integer,
  ToolName varchar(40),
  status varchar(100),
  start_time time,
  finish_time time
  PRIMARY KEY(JobId));
  
  CREATE TABLE ErrorLog(
  JobId integer,
  ErrCode integer,
  Description varchar(200),
  PRIMARY KEY(ErrCode)
  FOREIGN KEY(JobId) REFERENCES Job(JobId));
  
  CREATE TABLE BLAST(
  input varchar(100),
  database varchar(100),
  evalue varchar(100),
  JobId integer, 
  FOREIGN KEY (JobId) REFERENCES Job(JobId));
  
  CREATE TABLE MitoLoc(
  input varchar(100),
  specificity varchar(100),
  JobId integer,
  FOREIGN KEY (JobId) REFERENCES Job(JobId));
  </code></pre>