Find Valid Emails
<p>Table: <code>Users</code></p>

<pre>
+-----------------+---------+
| Column Name     | Type    |
+-----------------+---------+
| user_id         | int     |
| email           | varchar |
+-----------------+---------+
(user_id) is the unique key for this table.
Each row contains a user&#39;s unique ID and email address.
</pre>

<p>Write a solution to find all the <strong>valid email addresses</strong>. A valid email address meets the following criteria:</p>

<ul>
	<li>It contains exactly one <code>@</code> symbol.</li>
	<li>It ends with <code>.com</code>.</li>
	<li>The part before the <code>@</code> symbol contains only <strong>alphanumeric</strong> characters and <strong>underscores</strong>.</li>
	<li>The part after the <code>@</code> symbol and before <code>.com</code> contains a domain name <strong>that contains only letters</strong>.</li>
</ul>

<p>Return<em> the result table ordered by</em> <code>user_id</code> <em>in</em> <strong>ascending </strong><em>order</em>.</p>

<p>&nbsp;</p>
<p><strong class="example">Example:</strong></p>

<div class="example-block">
<p><strong>Input:</strong></p>

<p>Users table:</p>

<pre class="example-io">
+---------+---------------------+
| user_id | email               |
+---------+---------------------+
| 1       | alice@example.com   |
| 2       | bob_at_example.com  |
| 3       | charlie@example.net |
| 4       | david@domain.com    |
| 5       | eve@invalid         |
+---------+---------------------+
</pre>

<p><strong>Output:</strong></p>

<pre class="example-io">
+---------+-------------------+
| user_id | email             |
+---------+-------------------+
| 1       | alice@example.com |
| 4       | david@domain.com  |
+---------+-------------------+
</pre>

<p><strong>Explanation:</strong></p>

<ul>
	<li><strong>alice@example.com</strong> is valid because it contains one <code>@</code>, alice&nbsp;is alphanumeric, and example.com&nbsp;starts with a letter and ends with .com.</li>
	<li><strong>bob_at_example.com</strong> is invalid because it contains an underscore instead of an <code>@</code>.</li>
	<li><strong>charlie@example.net</strong> is invalid because the domain does not end with <code>.com</code>.</li>
	<li><strong>david@domain.com</strong> is valid because it meets all criteria.</li>
	<li><strong>eve@invalid</strong> is invalid because the domain does not end with <code>.com</code>.</li>
</ul>

<p>Result table is ordered by user_id in ascending order.</p>
</div>

[]
['CREATE TABLE If not Exists Users (\n    user_id INT,\n    email VARCHAR(255)\n)', 'Truncate table Users', "insert into Users (user_id, email) values ('1', 'alice@example.com')", "insert into Users (user_id, email) values ('2', 'bob_at_example.com')", "insert into Users (user_id, email) values ('3', 'charlie@example.net')", "insert into Users (user_id, email) values ('4', 'david@domain.com')", "insert into Users (user_id, email) values ('5', 'eve@invalid')"]
[{"value": "mysql", "text": "MySQL", "defaultCode": "# Write your MySQL query statement below\n"}, {"value": "mssql", "text": "MS SQL Server", "defaultCode": "/* Write your T-SQL query statement below */\n"}, {"value": "oraclesql", "text": "Oracle", "defaultCode": "/* Write your PL/SQL query statement below */\n"}, {"value": "pythondata", "text": "Pandas", "defaultCode": "import pandas as pd\n\ndef find_valid_emails(users: pd.DataFrame) -> pd.DataFrame:\n    "}, {"value": "postgresql", "text": "PostgreSQL", "defaultCode": "-- Write your PostgreSQL query statement below\n"}]
{"mysql": ["CREATE TABLE If not Exists Users (\n    user_id INT,\n    email VARCHAR(255)\n)"], "mssql": ["CREATE TABLE Users (\n    user_id INT,\n    email VARCHAR(255)\n)"], "oraclesql": ["CREATE TABLE Users (\n    user_id NUMBER,\n    email VARCHAR2(255)\n)"], "database": true, "name": "find_valid_emails", "postgresql": ["CREATE TABLE IF NOT EXISTS users (\n    user_id INT,\n    email VARCHAR(255)\n);\n"], "pythondata": ["Users = pd.DataFrame(columns=[\"user_id\", \"email\"]).astype({\"user_id\": \"int32\", \"email\": \"string\"})\n"], "database_schema": {"Users": {"user_id": "INT", "email": "VARCHAR(255)"}}}
{"mysql": ["MySQL", "<p><code>MySQL 8.0</code>.</p>"], "mssql": ["MS SQL Server", "<p><code>mssql server 2019</code>.</p>"], "oraclesql": ["Oracle", "<p><code>Oracle Sql 11.2</code>.</p>"], "pythondata": ["Pandas", "<p>Python 3.10 with Pandas 2.2.2 and NumPy 1.26.4</p>"], "postgresql": ["PostgreSQL", "<p>PostgreSQL 16</p>"]}
['Database']