What is a good analogy to introduce databases and SQL? I think that it is vital to introduce each subject area with a few handy, even if limited, images or concepts that make the idea clear. Here is how I introduce SQL (in part):  


  SQL takes a set of data and transforms it in to a new set: a two-dimensional result. Stop reading until you have memorized that, because it is the whole point. Every outcome of an SQL statement (with a few exceptions) is a new Table. That table might be printed on the screen and disappear, or it might be stored in to a new table, or it could be used to update an existing table, or it could be used as input to a program which could do… anything. But, it is a two-dimensional table, and nothing more.


I think that this is the very first concept that needs to lodge in their awareness if they are to make any progress at all. Perhaps it is incomplete, incorrect, too literal, doesn't use the right word (the correct word for Table is 'Relation') and so on. But we have to start somewhere.

I'll compare a database table to a table in Excel, because my students are more familiar with Excel. I'll compare SQL to a command line interface, because my students already know about command line interfaces. Are there better metaphors or analogies to teach SQL and relational database concepts?
I think that to understand the SELECT queries, the Who is Who? / Guess Who? game could serve as a nice metaphor.



The idea of the game is: you have a group of pictures of persons with different facial features. One gamer selects one of them and the other gamer has to make questions to try to eliminate the ones that are not relevant and try to guess which one the other gamer has chosen. It is kind of like what you do in the WHERE part of the SELECT...

SELECT faces 
FROM board 
WHERE hair = white 
AND has glasses 
AND has a mustache 
... 


Maybe this game is now so popular currently... it sure was when I was a kid.