def test_row_selection(persons):
    "Tests various ways to select rows."
    # Test top clause.
    Table.from_iter(persons.top(2)).print()
    Table.from_iter(persons.top(0.5)).print()
    # Test like operator.
    persons.where(Like('City', 's.*')).print()
    persons.where(Like('City', '.*s')).print()
    persons.where(Like('City', '.*tav.*')).print()
    persons.where(NotLike('City', '.*tav.*')).print()
    # Test wildcard patterns.
    persons.where(Like('City', 'sa.*')).print()
    persons.where(Like('City', '.*nes.*')).print()
    persons.where(Like('FirstName', '.la')).print()
    persons.where(Like('LastName', 'S.end.on')).print()
    persons.where(Like('LastName', '[bsp].*')).print()
    persons.where(Like('LastName', '[^bsp].*')).print()
    # Test in operator.
    persons.where(ROW.LastName.in_('Hansen', 'Pettersen')).print()
    # Test manual between syntax.
    persons.where(('Hansen' < ROW.LastName) < 'Pettersen').print()
    persons.where(('Hansen' <= ROW.LastName) < 'Pettersen').print()
    persons.where(('Hansen' <= ROW.LastName) <= 'Pettersen').print()
    persons.where(('Hansen' < ROW.LastName) <= 'Pettersen').print()
Tests various ways to select rows.
recipes/Python/577825_Rudimentary_Database_Engine/recipe-577825.py