title: Cannot add or update a child row: a foreign key constraint fails
body: <p>I need help...while creating a database I kept running into this error:</p>
  
  <pre><code>ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (`accident_db`.`participated`, CONSTRAINT `participated_ibfk_2` FOREIGN KEY (`license`) REFERENCES `car` (`license`))
  </code></pre>
  
  <p>The problem come in hand when I try to insert into participated. I Tried making the whole database over, coding it a diff way, checking the spelling, and other grammar errors.</p>
  
  <pre><code>CREATE TABLE person (
    driver_id VARCHAR(9) PRIMARY KEY,
    name VARCHAR(25),
    address VARCHAR(40)
  ) engine=innodb;
  
  CREATE TABLE car (
    license VARCHAR(8),
    model VARCHAR(15),
    year date,
    PRIMARY KEY(license)
  ) engine=innodb;
  
  
  CREATE TABLE accident (
    report_id VARCHAR(6),
    date date,
    location VARCHAR(25),
    PRIMARY KEY(report_id)
  ) engine=innodb;
  
  CREATE TABLE owns (
    driver_id VARCHAR(9),
    license VARCHAR(8),
    FOREIGN KEY(driver_id) REFERENCES person(driver_id),
    FOREIGN KEY(license) REFERENCES car(license),
    PRIMARY KEY(driver_id, license)
  ) engine=innodb;
  
  CREATE TABLE participated (
    driver_id VARCHAR(9),
    license VARCHAR(8) ,
    report_id VARCHAR(6),
    damage_amount decimal(10,2),
    FOREIGN KEY(driver_id) REFERENCES person(driver_id),
    FOREIGN KEY(license) REFERENCES car(license),
    FOREIGN KEY(report_id) REFERENCES accident(report_id),
    PRIMARY KEY(driver_id, license,report_id)
  ) engine=innodb;
  
  
      insert into person values('DRIVER001','John Smith','Tech, TN');
      insert into car values('AABB2000','BMW','2001');
      insert into accident values('AR2197','2014-04-08','Cookeville TN');
      insert into owns values('DRIVER001','AABB2000');
      insert into participated values('DRIVER002','AR2197','CCDD3000','1500');
  </code></pre>