LIKE starts with visible strings and NULLs.

highlighted = computed this step

Base rows

LIKE starts with visible strings and NULLs.

read strings first\text{read strings first}

Show the input

The table has 6 source rows.

source rows=6\text{source rows}=6

LIKE-pattern examples are tiny finite WHERE-style filters with a small SQL-like pattern subset; collations, escapes, dialect behavior, indexes, optimizer behavior, and product claims are out of scope.

Base rows: base rowsidname1Ada2Al3Alan4Bea5Jo6NULL LIKE evaluationsourcevaluepatterntruthkept0Ada%TRUEyes1Al%TRUEyes2Alan%TRUEyes3Bea%TRUEyes4Jo%TRUEyes5NULL%UNKNOWNno LIKE output rowsidname1Ada2Al3Alan4Bea5Jo LIKE factsfactvalueinputRowCount6outputRowCount5trueRows5falseRows0unknownRows1patternKindpercentrowOrdersource_order

One pattern at a time

This book uses one literal pattern against one string column.

one column one pattern\text{one column one pattern}

Summary

LIKE asks whether each visible string matches the pattern.

match each row\text{match each row}