Imagine the following table or spreadsheet... It might be a table (or subset of a table) of CS courses from Fall 2017.
Code | Section | Term | Year | StartDate | Title | Cap | Enrollment |
---|---|---|---|---|---|---|---|
COMP 105 | 01 | Fall | 2017 | 09/11/2017 | Intro to CS | 15 | 15 |
COMP 105 | 02 | Fall | 2017 | 09/11/2017 | Intro to CS | 15 | 15 |
COMP 108 | 01 | Fall | 2017 | 09/11/2017 | Scientific Computing | 20 | 22 |
COMP 210 | 01 | Fall | 2017 | 09/11/2017 | Data Structures | 25 | 15 |
COMP 489 | 01 | Fall | 2017 | 09/11/2017 | Mobile Development | 15 | 11 |
COMP 490 | 01 | Fall | 2017 | 09/11/2017 | SR Sem | 15 | 21 |
Note: this table has a certain amount of repetition.
What if it's a larger table (e.g., 2 years' worth of Fall courses)?
Code | Section | Term | Year | Title | Cap | Enrollment | StartDate |
---|---|---|---|---|---|---|---|
COMP 105 | 01 | Fall | 2016 | 09/12/2016 | Intro to CS | 15 | 14 |
COMP 105 | 02 | Fall | 2016 | 09/12/2016 | Intro to CS | 15 | 15 |
COMP 108 | 01 | Fall | 2016 | 09/12/2016 | Scientific Computing | 20 | 17 |
COMP 210 | 01 | Fall | 2016 | 09/12/2016 | Data Structures | 25 | 17 |
COMP 488 | 01 | Fall | 2016 | 09/12/2016 | FOSS Development | 15 | 15 |
COMP 490 | 01 | Fall | 2016 | 09/12/2016 | SR Sem | 15 | 16 |
COMP 105 | 01 | Fall | 2017 | 09/11/2017 | Intro to CS | 15 | 15 |
COMP 105 | 02 | Fall | 2017 | 09/11/2017 | Intro to CS | 15 | 15 |
COMP 108 | 01 | Fall | 2017 | 09/11/2017 | Scientific Computing | 20 | 22 |
COMP 210 | 01 | Fall | 2017 | 09/11/2017 | Data Structures | 25 | 15 |
COMP 489 | 01 | Fall | 2017 | 09/11/2017 | Mobile Development | 15 | 11 |
COMP 490 | 01 | Fall | 2017 | 09/11/2017 | SR Sem | 15 | 21 |
Note: this table has both more repetition (e.g., "Intro to CS") and more variation (e.g., the year is not always 2017).
SELECT * FROM Courses ORDER BY StartDate, Code;
Code | Section | Term | Year | StartDate | Title | Cap | Enrollment |
---|---|---|---|---|---|---|---|
COMP 105 | 01 | Fall | 2016 | 09/12/2016 | Intro to CS | 15 | 14 |
COMP 105 | 02 | Fall | 2016 | 09/12/2016 | Intro to CS | 15 | 15 |
COMP 108 | 01 | Fall | 2016 | 09/12/2016 | Scientific Computing | 20 | 17 |
COMP 210 | 01 | Fall | 2016 | 09/12/2016 | Data Structures | 25 | 17 |
COMP 488 | 01 | Fall | 2016 | 09/12/2016 | FOSS Development | 15 | 15 |
COMP 490 | 01 | Fall | 2016 | 09/12/2016 | SR Sem | 15 | 16 |
COMP 105 | 01 | Winter | 2017 | 01/03/2017 | Intro to CS | 15 | 21 |
COMP 110 | 01 | Winter | 2017 | 01/03/2017 | Intro to Prog | 15 | 18 |
COMP 110 | 02 | Winter | 2017 | 01/03/2017 | Intro to Prog | 15 | 14 |
COMP 215 | 01 | Winter | 2017 | 01/03/2017 | Algorithms | 25 | 27 |
COMP 430 | 01 | Winter | 2017 | 01/03/2017 | Op. Sys. | 20 | 23 |
COMP 483 | 01 | Winter | 2017 | 01/03/2017 | Cryptography | 20 | 20 |
COMP 107 | 01 | Spring | 2017 | 03/27/2017 | Pictures & Sound | 15 | 14 |
COMP 107 | 02 | Spring | 2017 | 03/27/2017 | Pictures & Sound | 15 | 17 |
COMP 110 | 01 | Spring | 2017 | 03/27/2017 | Intro to Prog | 15 | 16 |
COMP 210 | 01 | Spring | 2017 | 03/27/2017 | Data Structures | 25 | 17 |
COMP 230 | 01 | Spring | 2017 | 03/27/2017 | Comp. Org. | 25 | 21 |
COMP 300 | 01 | Spring | 2017 | 03/27/2017 | Automata | 20 | 26 |
COMP 105 | 01 | Fall | 2017 | 09/11/2017 | Intro to CS | 15 | 15 |
COMP 105 | 02 | Fall | 2017 | 09/11/2017 | Intro to CS | 15 | 15 |
COMP 108 | 01 | Fall | 2017 | 09/11/2017 | Scientific Computing | 20 | 22 |
COMP 210 | 01 | Fall | 2017 | 09/11/2017 | Data Structures | 25 | 15 |
COMP 489 | 01 | Fall | 2017 | 09/11/2017 | Mobile Development | 15 | 11 |
COMP 490 | 01 | Fall | 2017 | 09/11/2017 | SR Sem | 15 | 21 |
Note: this table has even more repetition (e.g., "Intro to CS") and more
variation (e.g., the term is not always Fall).
Note also: some data items always go together, e.g., COMP 105 always has
the same title and the same cap; a given term always starts on the same
date.