This solution is currently encapsulated in a single SQL file which can be used to create a database, the schema and queries to trial supplied datasets.
See https://github.com/cfframe/Share-Profit-Coding-Challenge/blob/master/README.md for detail of the challenge itself.