SQL Query & Data Mapping Codes and Tests.