MySQL solution with REGEXP
IntuitionUse REGEXP for data filtering.ApproachWe can filter the 'email' column using REGEX expression, that will do the following:^: matches the beginning of t
# Intuition
Use REGEXP for data filtering.

# Approach
We can filter the 'email' column using REGEX expression, that will do the following:

^: matches the beginning of text.
[A-Za-z0-9_]+: matches one or more alphanumeric characters (uppercase or lowercase) or underscores. This will take all before the @ symbol.
@: matches the @ symbol.
[A-Za-z]+: matches one or more letter (uppercase or lowercase). Capture the domain name part.
\\.com: matches the .com (the \ escapes the . to treat it as a literal dot, not a wildcard).
$: matches the end of text.

ORDER BY just sorting the values in required order.

# Complexity
- Time complexity:
O(n log n) - because of the ORDER BY sorting. Without it - will improve to O(n).

- Space complexity:
O(n) - as we're selecting all the rows in the table with 'SELECT *'.

# Code
```mysql []
# Write your MySQL query statement below
SELECT *
FROM Users
WHERE email REGEXP '^[A-Za-z0-9_]+@[A-Za-z]+\\.com$'
ORDER BY user_id;
```
['MySQL']