Exam Data-Engineer-Associate Topic 1 Question 193 Discussion
Actual exam question for Amazon's Data-Engineer-Associate exam
Question #: 193
Topic #: 1
Question #: 193
Topic #: 1
A company has a data warehouse that contains a table that is named Sales. The company stores the table in Amazon Redshift The table includes a column that is named city_name. The company wants to query the table to find all rows that have a city_name that starts with "San" or "El." Which SQL query will meet this requirement?
Suggested Answer: B Vote an answer
To query the Sales table in Amazon Redshift for city names that start with "San" or "El," the appropriate query uses a regular expression (regex) pattern to match city names that begin with those prefixes.
* Option B: Select * from Sales where city_name ~ '^(San|El)';In Amazon Redshift, the ~ operator is used to perform pattern matching using regular expressions. The ^(San|El) pattern matches city names that start with "San" or "El." This is the correct SQL syntax for this use case.
Other options (A, C, D) contain incorrect syntax or incorrect use of special characters, making them invalid queries.
References:
* Amazon Redshift Pattern Matching Documentation
* Option B: Select * from Sales where city_name ~ '^(San|El)';In Amazon Redshift, the ~ operator is used to perform pattern matching using regular expressions. The ^(San|El) pattern matches city names that start with "San" or "El." This is the correct SQL syntax for this use case.
Other options (A, C, D) contain incorrect syntax or incorrect use of special characters, making them invalid queries.
References:
* Amazon Redshift Pattern Matching Documentation
by Willie at Feb 05, 2026, 03:19 AM
0
0
0
10
Comments
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Report Comment
Commenting
You can sign-up / login (it's free).