Database Interfaces, Implementation and Tests.   SQL Server schema script

Created database interfaces, implementation and tests.  Also added SQL Server schema script.
don't use 'magic numbers' use constants - they are self-documenting and also make the code easier  and safer to modify.