Anonymous interview question

Write factorial code Sql joins query Enumeration