def _has_sql_attribute(line: str, attr_type: str) -> bool:
    """
    Check whether a string contains a specific SQL element
    or statement.

    :param line: A line from a SQL dump file.
    :type line: str
    :param attr_type: Element or statement type, e.g "primary_key"
        for a table's primary key or "insert" for INSERT INTO statements.
    :type attr_type: str
    :return: True or False
    :rtype: bool
    """

    line_start = {
        "database": "--",
        "insert": "INSERT INTO",
        "create": "CREATE TABLE",
        "primary_key": "PRIMARY KEY",
        "col_name": "`",
    }
    contains_element = line.strip().startswith(line_start[attr_type])

    if attr_type == "database":
        return contains_element and "Database: " in line

    return contains_element