91.3k views
0 votes
Which row or rows will be selected by the following WHERE statement?

where Job_Title like "Sales%";

Obs--Last_Name--First_Name--Country--Job_Title
1----------Wu--------Christine-----AU----Sales Rep I
2--------Stone-------Kimiko-------AU--Sales Manager
3-------Hoffman-----Fred--------AU--Insurance Sales

a. row 1
b. row 2
c. row 3
d. rows 1 and 2
e. all rows

User Shamima
by
8.4k points

1 Answer

6 votes

Final answer:

The WHERE statement 'WHERE Job_Title LIKE "Sales%"' matches any job titles starting with 'Sales'. Therefore, rows 1 and 2 will be selected, as their Job_Title fields begin with 'Sales', whereas row 3 will not be selected.

Step-by-step explanation:

The query WHERE Job_Title LIKE "Sales%" selects rows where the Job_Title begins with 'Sales.' The percent sign (%) is a wildcard in SQL that matches zero or more characters. Therefore, the query would select rows where the Job_Title starts with 'Sales' regardless of any characters that come after it.

In the provided data set, row 1 with Job_Title 'Sales Rep I' and row 2 with Job_Title 'Sales Manager' match the condition because both job titles start with 'Sales.' However, row 3 does not match because its Job_Title is 'Insurance Sales,' which does not start with 'Sales' (it starts with 'Insurance').

Based on this explanation, the correct answer is d. rows 1 and 2 will be selected by the WHERE statement.

User Al Imran
by
9.0k points