CREATE TABLE departments(deptId VARCHAR(10),
                      deptName VARCHAR(225) NOT NULL,
                      location VARCHAR(225) NOT NULL,
                      PRIMARY KEY (deptId));

CREATE TABLE visitors(visitId INT AUTO_INCREMENT,
                      visitDate DATE NOT NULL,
                      visitorName VARCHAR(30) NOT NULL,
                      visitorEmail VARCHAR(100) NOT NULL,
                      visitorPhone VARCHAR(255) NOT NULL,
                      whomToMeet VARCHAR(255) NOT NULL,
                      deptId VARCHAR(10) NOT NULL,
                      hasAppt VARCHAR(3) NOT NULL,
                      FOREIGN KEY (deptId) REFERENCES departments(deptId),
                      PRIMARY KEY (visitId));

INSERT INTO departments VALUES ('HR', 'Human Resources', 'AAA Building, Room 444');
INSERT INTO departments VALUES ('IT', 'Information Technology and Support', 'BBB Building, Room 111');
INSERT INTO departments VALUES ('CS', 'Computer Science', 'CCC Building, Room 555');

INSERT INTO visitors (visitDate, visitorName, visitorEmail, visitorPhone, whomToMeet, deptId, hasAppt) VALUES ('2026-03-08', 'someone', 'someone@uva.edu', '111-111-1111', 'someone else', 'IT', 'yes');
