When I ask SQL questions I'm looking for a few important things.
1. Have you written SQL
2. Do you understand keys and joins
3. Do you understand one to one, one to many, and many to many relationships
4. Do you know any advanced language features: window functions, CTEs, grouping sets, strategies for pivoting data in different dbs, etc.
I don't care if you write syntactically correct SQL or even remember all the keywords. Just as long as you can talk intelligently about some of those concepts.
I love Venn diagrams and I used to think these were fine, but I already intimately knew all about joins. Then someone said to me these diagrams don't make sense to describe joins. Today I'm in full agreement.
An 'element' is not in both table A and B, rather there are rows in A and rows in B which can have matching conditions (sometimes multiple times) or not. Showing these diagrams to someone to explain joins gives them a poor/mis-understanding of joins and Venn diagrams.
Instead on only complaining, I'll make an off the cuff suggestion as to a better diagram. Show two table-like-pictures with many rows each. Shade some rows of either side and say these have rows in the other table that match the ON condition. Then explain which rows get returned by each type of join. (bonus points for illustrating many-to-many matches)
1. Have you written SQL 2. Do you understand keys and joins 3. Do you understand one to one, one to many, and many to many relationships 4. Do you know any advanced language features: window functions, CTEs, grouping sets, strategies for pivoting data in different dbs, etc.
I don't care if you write syntactically correct SQL or even remember all the keywords. Just as long as you can talk intelligently about some of those concepts.