SQL for creating base db