Generate simple sql select queries