College SQL class, using the book "SQL Fundamentals" by John J. Patrick. In the third chapter, he talks about using a "table of constants" to add columns to a select statement, where all rows have the same value.
For example, if you have table "characters", as so:
first_name last_name dept_code ----------- ---------- ------------------- Fred Flintstone ROCKS Barney Rubble ROCKS Wilma Flintstone FACEPALMING_AT_FRED
and you want a SELECT that adds a column "hometown" with value "BEDROCK" to all rows, he recommends making a second table in the database, "temp", with
hometown -------- BEDROCK
and then doing
SELECT first_name, last_name, dept_code, hometown FROM characters, temp
The idea is that this avoids putting string constants in the SELECT statement, and that if you've got a lot of SELECTs that need the same constants, it's easier to update one table than fifty queries.
The thing is, I've been working with SQL databases for the last fifteen years, and I have never seen this construction. Is it something totally common that I've just missed, or is it something that I can erase from my memory after this assignment is over?