DROP TABLE IF EXISTS training;
DROP TABLE IF EXISTS person;

CREATE TABLE person (
	person_id INTEGER AUTO_INCREMENT,
	lastname  VARCHAR(30) NOT NULL,
	firstname VARCHAR(20),
	phone     VARCHAR(20),
	PRIMARY KEY (person_id)
) ENGINE=InnoDB;


CREATE TABLE training (
	person_id INTEGER,
	code_id   INTEGER,
	year      INTEGER
) ENGINE=InnoDB;


INSERT INTO person (lastname,firstname,phone) VALUES ('Jones','Henry','325-672-1818');
INSERT INTO person (lastname,firstname,phone) VALUES ('Smith','Mary','325-675-6723');
INSERT INTO person (lastname,firstname,phone) VALUES ('Williams','John','870-246-5515');
INSERT INTO person (lastname,firstname,phone) VALUES ('Anderson','Molly','214-596-7643');
INSERT INTO person (lastname,firstname,phone) VALUES ('Rodriquez','Juan','817-898-2212');

INSERT INTO training (person_id,code_id,year) VALUES (1,1,2012);
INSERT INTO training (person_id,code_id,year) VALUES (1,3,2013);
INSERT INTO training (person_id,code_id,year) VALUES (2,2,2014);
INSERT INTO training (person_id,code_id,year) VALUES (2,3,2011);
INSERT INTO training (person_id,code_id,year) VALUES (3,4,2012);
INSERT INTO training (person_id,code_id,year) VALUES (4,1,2011);
INSERT INTO training (person_id,code_id,year) VALUES (4,2,2013);
INSERT INTO training (person_id,code_id,year) VALUES (5,2,2012);
INSERT INTO training (person_id,code_id,year) VALUES (5,3,2013);
INSERT INTO training (person_id,code_id,year) VALUES (5,4,2014);

