sql snippets for OS data