Create sql for needed tables