QCombobox Case selection - Pyside2 Index via Sqlite
Well you have already identified the problem: repetition.
It can be tackled fairly easily. Instead of that if/elif block you can use a (zero-indexed) list that contains the WHERE clause for the query:

    options = [ None, '%html%', '%javascript%']
    query = "SELECT url,size,content_type FROM 'google.com.au'"

    if options[index] is not None:
        query += f" WHERE content_type LIKE '{options[index]}'"

    sourceModel = QSqlQueryModel()
    sourceModel.setQuery(query, db)
    proxyModel = QSortFilterProxyModel(self)
    proxyModel.setSourceModel(sourceModel)
    self.tableView.setModel(proxyModel)
    self.tableView.setSortingEnabled(True)


Only the first option is different: there is no WHERE clause. In the other places the request is always the same, it's only the search pattern that is different.

What I am doing here is simply selective string concatenation. Note: using an F-string for the WHERE clause, requires Python >= 3.6. Usage is not mandatory but if you have a recent version of Python embrace the new features.

Instead of None you could say '' (an empty string). I chose None to signify option #0 is a special case. I am not checking that index is actually in the range 0->2. If you think this could happen, add a if to check.