{ "data": { "question": { "questionId": "3782", "questionFrontendId": "3436", "categoryTitle": "Database", "boundTopicId": 3059804, "title": "Find Valid Emails", "titleSlug": "find-valid-emails", "content": "
Table: Users
\n+-----------------+---------+\n| Column Name | Type |\n+-----------------+---------+\n| user_id | int |\n| email | varchar |\n+-----------------+---------+\n(user_id) is the unique key for this table.\nEach row contains a user's unique ID and email address.\n\n\n
Write a solution to find all the valid email addresses. A valid email address meets the following criteria:
\n\n@
symbol..com
.@
symbol contains only alphanumeric characters and underscores.@
symbol and before .com
contains a domain name that contains only letters.Return the result table ordered by user_id
in ascending order.
\n
Example:
\n\nInput:
\n\nUsers table:
\n\n\n+---------+---------------------+\n| user_id | email |\n+---------+---------------------+\n| 1 | alice@example.com |\n| 2 | bob_at_example.com |\n| 3 | charlie@example.net |\n| 4 | david@domain.com |\n| 5 | eve@invalid |\n+---------+---------------------+\n\n\n
Output:
\n\n\n+---------+-------------------+\n| user_id | email |\n+---------+-------------------+\n| 1 | alice@example.com |\n| 4 | david@domain.com |\n+---------+-------------------+\n\n\n
Explanation:
\n\n@
, alice is alphanumeric, and example.com starts with a letter and ends with .com.@
..com
..com
.Result table is ordered by user_id in ascending order.
\n\\u7248\\u672c\\uff1a mssql server 2019.<\\/p>\"],\"oraclesql\":[\"Oracle\",\" Oracle Sql 11.2.<\\/p>\"],\"pythondata\":[\"Pandas\",\" Python 3.10 with Pandas 2.2.2 and NumPy 1.26.4<\\/p>\"],\"postgresql\":[\"PostgreSQL\",\" PostgreSQL 16<\\/p>\"]}",
"book": null,
"isSubscribed": false,
"isDailyQuestion": false,
"dailyRecordStatus": null,
"editorType": "CKEDITOR",
"ugcQuestionId": null,
"style": "LEETCODE",
"exampleTestcases": "{\"headers\":{\"Users\":[\"user_id\",\"email\"]},\"rows\":{\"Users\":[[1,\"alice@example.com\"],[2,\"bob_at_example.com\"],[3,\"charlie@example.net\"],[4,\"david@domain.com\"],[5,\"eve@invalid\"]]}}",
"__typename": "QuestionNode"
}
}
}MySQL 8.0<\\/code><\\/p>\"],\"mssql\":[\"MS SQL Server\",\"