exam questions

Exam AWS Certified Data Engineer - Associate DEA-C01 All Questions

View all questions & answers for the AWS Certified Data Engineer - Associate DEA-C01 exam

Exam AWS Certified Data Engineer - Associate DEA-C01 topic 1 question 95 discussion

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?

  • A. Select * from Sales where city_name ~ ‘$(San|El)*’;
  • B. Select * from Sales where city_name ~ ‘^(San|El)*’;
  • C. Select * from Sales where city_name ~’$(San&El)*’;
  • D. Select * from Sales where city_name ~ ‘^(San&El)*’;
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
chrispchrisp
Highly Voted 11 months, 2 weeks ago
Selected Answer: B
Regex Patterns for everyone's reference . : Matches any single character. * : Matches zero or more of the preceding element. + : Matches one or more of the preceding element. [abc] : Matches any of the enclosed characters. [^abc] : Matches any character not enclosed. ^ : Matches the start of a string. $ : Matches the end of a string. | : Logical OR operator. (abc) : Matches 'abc' and remembers the match. Answer is B
upvoted 8 times
...
andrologin
Most Recent 11 months, 3 weeks ago
Selected Answer: B
Regex patterns: ^ - used to capture the start of the text/string | - used as an OR operator
upvoted 1 times
...
bakarys
1 year ago
Selected Answer: B
B. Select * from Sales where city_name ~ ‘^(San|El)*’; This query uses a regular expression pattern with the ~ operator. The caret ^ at the beginning of the pattern indicates that the match must start at the beginning of the string. (San|El) matches either “San” or “El”, and * means zero or more of the preceding element. So this query will return all rows where city_name starts with either “San” or “El”.
upvoted 1 times
...
HunkyBunky
1 year ago
Selected Answer: B
B - becuase of regexp
upvoted 1 times
...
JohnYang
1 year ago
Selected Answer: B
^ asserts the position at the start of the string. (San|El) matches either "San" or "El".
upvoted 3 times
...
tgv
1 year ago
Selected Answer: B
~: This operator indicates the use of a regular expression. ^: This symbol signifies the start of the string. (San|El): This pattern matches strings that start with either "San" or "El".
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

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.

SaveCancel
Loading ...