Fixing issue with input count in creation db script.
Changing selection types to if statements.
Adding variation type 4. Fixing lambda log issue.
Adding more trails to sql.