How to generate 1 million random email addresses using SQL

In this experiment we will look into a (simple) way to generate 1 million fake, random email addresses using SQL (SQL Server 2019 as the tool of choice, but it can be easily done with MySQL, Oracle etc).

We start with a list of 1000 fake, random names obtained from https://www.randomlists.com/

Then we write some SQL to make a little explosion and get to 1000000 names and email addresses.

The obtained email list can be useful for consumption by various applications / websites that you are developing and/or testing or just to show off your SQL skills to your dog.

Enjoy 🙂

You are right, if you modify the input names list total number, you’ll get the new n x n output list total number.

Final result (tables and mechanism to insert the data) is available on GitHub:

https://github.com/Eduard-Uta/Experiments/tree/main/One%20million%20random%20email%20addresses%20using%20SQL

Leave a Comment