Well, to get this started, I think you want to go back to your university days and, indeed, create a user login. For the administrators, if nobody else.
You could probably combine that with the tracking stuff.
Maybe this:
Code:
CREATE TABLE volunteers (
volid INT AUTO_INCREMENT PRIMARY KEY,
loginName VARCHAR(30),
firstName VARCHAR(30),
lastName VARCHAR(30),
loginPassword VARCHAR(20),
isAdministrator BOOLEAN,
isSupervisor BOOLEAN,
isXXX BOOLEAN,
isYYY BOOLEAN
);
isXXX and isYYY are not real... just placeholders for other possible levels of responsibility you might want to assign. You could also (or instead) have a numeric
adminLevel field. All depends on how you want to control access to various web pages and/or data in the DB.
And then, for the project you metioned:
Code:
CREATE TABLE activities (
actid INT AUTO_INCREMENT PRIMARY KEY,
activity VARCHAR( 200 ),
... any other fields to describe the activity ...
... maybe even something like ...
requiresAdministrator BOOLEAN, /* only admins can do this activity when true */
requiresSupervisor BOOLEAN, /* only supervisors when true */
...
);
CREATE TABLE volunteerActivities (
volid INT,
actid INT,
startTime DATETIME,
endTime DATETIME,
reason VARCHAR(1000),
... other fields to describe what volunteer did ...
CONSTRAINT FOREIGN KEY volid REFERENCES volunteers(volid),
CONSTRAINT FOREIGN KEY actid REFERENCES activities(actid)
);
So your
volunteerActivites table is actually a MANY-TO-MANY table (look it up if you aren't familiar with the term).
And now you have a design that will support a myriad of interesting queries.