Added test for sex difference

Most of the work is new SQL queries and techniques.