I would like to write code to input multiple date ranges for one person. For example, I am trying to create a table to keep track of employee vacation time. Let’s say:
-Jeff takes off 2/13-2/19 and 12/5-12/7
-Molly takes off 5/3
-Jane takes off 1/5-1/10 and 7/19-8/24 and 11/14-11/23
I would like to input all these ranges for each person and query based on date. I would like to know all the employees who took time off on 7/20, for example.
I wrote this so far but I am stumped on the date portion. Most resources online show you how to store one date per record.
CREATE TABLE vacayTracker
(employeeID INT NOT NULL auto_increment,
Name VARCHAR(100),
Email VARCHAR(100),
vacationDays DATE,
PRIMARY KEY (employeeID))
fiiano is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.