DROP TABLE EMPLOYEE;
DROP TABLE DEPARTMENT;

CREATE TABLE DEPARTMENT (ID INTEGER NOT NULL, NAME VARCHAR(255), PRIMARY KEY (ID));
CREATE TABLE EMPLOYEE (ID INTEGER NOT NULL, NAME VARCHAR(255), SALARY BIGINT, 
                       DEPARTMENT_ID INTEGER, PRIMARY KEY (ID),
                       CONSTRAINT DEPARTMENT_FK FOREIGN KEY (DEPARTMENT_ID) REFERENCES DEPARTMENT (ID));

INSERT INTO DEPARTMENT (ID, NAME) VALUES (1, 'Engineering');
INSERT INTO DEPARTMENT (ID, NAME) VALUES (2, 'CA13');
INSERT INTO DEPARTMENT (ID, NAME) VALUES (3, 'CA19');

INSERT INTO EMPLOYEE (ID, NAME, SALARY, DEPARTMENT_ID) VALUES (1, 'Joan', 59000, 1);
INSERT INTO EMPLOYEE (ID, NAME, SALARY, DEPARTMENT_ID) VALUES (2, 'Sarah', 52000, 2);
INSERT INTO EMPLOYEE (ID, NAME, SALARY, DEPARTMENT_ID) VALUES (3, 'John', 55000, 2);
INSERT INTO EMPLOYEE (ID, NAME, SALARY, DEPARTMENT_ID) VALUES (4, 'Roberts', 53000, 2);
INSERT INTO EMPLOYEE (ID, NAME, SALARY, DEPARTMENT_ID) VALUES (5, 'Peter', 50000, 2);
INSERT INTO EMPLOYEE (ID, NAME, SALARY, DEPARTMENT_ID) VALUES (6, 'Frank', 51000, 1);
INSERT INTO EMPLOYEE (ID, NAME, SALARY, DEPARTMENT_ID) VALUES (7, 'Scott', 60000, 1);
INSERT INTO EMPLOYEE (ID, NAME, SALARY, DEPARTMENT_ID) VALUES (8, 'Sue', 62000, 1);
INSERT INTO EMPLOYEE (ID, NAME, SALARY, DEPARTMENT_ID) VALUES (9, 'Stephanie', 54000, 1);
INSERT INTO EMPLOYEE (ID, NAME, SALARY, DEPARTMENT_ID) VALUES (10, 'Jennifer', 55000, 1);
INSERT INTO EMPLOYEE (ID, NAME, SALARY, DEPARTMENT_ID) VALUES (11, 'Marcus', 35000, NULL);