Random Monster Name Generator

21 Mar 2017

This query generates a random monster name for when you feel you are lacking creativity to think of one.

I began compiling a list of random adjectives and nouns into a text file and bulk inserted the words into my monster_names table. The cross join is used to generate a new name from all the possible rows from the adjective column with the nouns column. The ORDER BY newid() ensures random ordering and reduces the chance of the same adjective or noun appearing twice.

The compiled list I made can be found here.


CREATE DATABASE monster_name_db;

Create table monster_names(
adjectives varchar(50),
nouns varchar(50));

BULK INSERT monster_names FROM 'C:/Users/Michael/Desktop/monster adjectives and nouns.txt' 
With (FIELDTERMINATOR = ' ', ROWTERMINATOR = '0x0a');

SELECT TOP 5 CONCAT(a.adjectives, ' ', b.nouns) as 'Name Generator'
FROM monster_names a 
CROSS JOIN monster_names b group by a.adjectives, b.nouns
ORDER BY newid();

Output: