sql script for cork results