I would give a poorly written query and ask them how they will tune performance.
I would ask about set theory. If you do not understand how to work in sets, you cannot efficiently query a relational database.
I would give them some examples of cursors and ask how they rewrite them to make them set-based.
If the task involved import and export, I would ask questions about SSIS (or other tools involved in this used by other databases). If it was about writing reports, I would like to know that they understand aggregates and groupings (as well as Crystal Reports or SSRS or any other tool that you use).
I would ask the difference in results between these three queries:
select a.field1 , a.field2 , b.field3 from table1 a join table2 b on a.id = b.id where a.field5 = 'test' and b.field3 = 1 select a.field1 , a.field2 , b.field3 from table1 a left join table2 b on a.id = b.id where a.field5 = 'test' and b.field3 = 1 select a.field1 , a.field2 , b.field3 from table1 a left join table2 b on a.id = b.id and b.field3 = 1 where a.field5 = 'test'
HLGEM Jan 22 '10 at 20:01 2010-01-22 20:01
source share