Can you at least explain the meaning of the fields???
This *FEELS* to me like it's for an academic institution.
You have "Class Years" (or "Fiscal Years") of 2006, 2007, etc.
So
[2007] = 'Full Time'
means
"A full time student during the 2007-2008 academic year."
No? And then
StartYear=2007 AND Starts='Spring'
means that the student started classes during the Spring quarter/semester of 2007. And unless I miss my guess, "Spring 2007" is really part of the [2006] academic year. So if all that is true, I don't understand why you are testing
[2007] IN ('Full - Time','Part - Time')
AND startYear=2006
AND Starts='Fall'
Wouldn't "Fall 2006" be part of the [2006] academic year, too???
The whole system is screwy.
If you are going to base SOME things on academic year (e.g., [2007]='Part - Time') then why are other things based on physical year (e.g., startYear=2007)????
On top of that, how can you do an ORDER BY that makes sense, based on startYear and starts????
ORDER BY startYear, starts
will get you
2006, Fall
2006, Spring
2006, Summer
2006, Winter
which doesn't make sense from either a physical *OR* academic year standpoint.
Personally, assuming that you are indeed talking about an academic institution here, I would have based *EVERYTHING* on academic year.
So I'd have
term = 2006.1 [Fall, 2006 academic year, September 2006 start]
term = 2006.2 [Winter, 2006 academic year, January 2007 start]
term = 2006.3 [Spring, 2006 academic year, April 2007 start]
term = 2006.4 [Summer, 2006 academic year, July 2007 start]
[Or, if at this institution Summer is the first quarter/term, just change the numbering to match]
And then you'd have a one-to-many relationship from the main table (which specifies when that student started, using my "term" notation) to the "worked" table. So it might look like this:
Code:
TABLE: mainWork
student : termStarted
17 : 2007.1
32 : 2006.3
TABLE: worked
student : academicYear : fullOrPartTime
17 : 2007 : F
17 : 2008 : P
32 : 2006 : P
32 : 2007 : F
32 : 2008 : P
And so on.