This is the query I am using to retrieve the data I want to put into a timetable.
SELECT * FROM timetable
WHERE progCode=1OK
AND sem =1
ORDER BY time,day
time day courseCode location type
9 1 IE876 3 B Industrial 2
9 2 HP851 Room AC 133 1
9 3 IE875 3 B Industrial 1
9 5 IE877 Dillon Theatre 1
10 1 IE876 3 B Industrial 2
10 2 EP853 Room AC 133 1
10 3 IE875 3 B Industrial 1
10 4 IE877 Bromwich Suite 3
11 4 IE877 Bromwich Suite 3
14 1 EP853 Physics Lab 2
14 2 IE876 3 B Industrial 1
14 3 IE876 3 B Industrial 1
14 4 IE877 3
14 5 LW851 Block S 1
The timetable will have days across the top and hours down the side.
I have the data sorted on time and then on day. The number represents the day of the week.
I will have a row with cells for classes taking place at 9.
A row with cells for classes taking place at 10 etc like an ordinary timetable.
my question is
Would I be better off selecting the data for all the classes on at 9 and making that row. Then selecting all classes on at 10 and so on like the following
SELECT * FROM timetable
WHERE progCode=1OK
AND sem = 9
AND time = 9
ORDER BY time,day
There would be 7 selects.
would this approach be more expensive in terms of time than the approach using the first sql statement given that the first one would require more loops , if statements etc
SELECT * FROM timetable
WHERE progCode=1OK
AND sem =1
ORDER BY time,day
time day courseCode location type
9 1 IE876 3 B Industrial 2
9 2 HP851 Room AC 133 1
9 3 IE875 3 B Industrial 1
9 5 IE877 Dillon Theatre 1
10 1 IE876 3 B Industrial 2
10 2 EP853 Room AC 133 1
10 3 IE875 3 B Industrial 1
10 4 IE877 Bromwich Suite 3
11 4 IE877 Bromwich Suite 3
14 1 EP853 Physics Lab 2
14 2 IE876 3 B Industrial 1
14 3 IE876 3 B Industrial 1
14 4 IE877 3
14 5 LW851 Block S 1
The timetable will have days across the top and hours down the side.
I have the data sorted on time and then on day. The number represents the day of the week.
I will have a row with cells for classes taking place at 9.
A row with cells for classes taking place at 10 etc like an ordinary timetable.
my question is
Would I be better off selecting the data for all the classes on at 9 and making that row. Then selecting all classes on at 10 and so on like the following
SELECT * FROM timetable
WHERE progCode=1OK
AND sem = 9
AND time = 9
ORDER BY time,day
There would be 7 selects.
would this approach be more expensive in terms of time than the approach using the first sql statement given that the first one would require more loops , if statements etc