sql for flooring