sql script for live