sql patterns every analyst should know