def sqlite_like(p, s):
    """Function to be used a `s LIKE p` operator in SQLite statements.
    >>> sqlite_like('Starts with%', 'Starts with this')
    True
    >>> sqlite_like('Starts with%', ' Starts with this')
    False
    >>> sqlite_like('%ends with', '... ends with')
    True
    >>> sqlite_like('%ends with', ' ends with ...')
    False
    >>> sqlite_like('%contains%', 'This contains the pattern')
    True
    >>> sqlite_like('%contains%', 'This doesn't contain the pattern')
    False
    >>> sqlite_like('This is the pattern', 'This is the pattern')
    True
    >>> sqlite_like('This is the pattern', 'This is not the pattern')
    False
    >>> sqlite_like('', 'Anything')
    True
    """
    if not p:
        return True
    l = p[-1] == '%'
    if p[0] == '%':
        if l:
            return p[1:-1] in s
        else:
            return s.endswith(p[1:])
    elif l:
        return s.startswith(p[:-1])
    else:
        return s == p
  

