Anagrams
Remember the english_words
table from the Palindromes challenge?
column_name | type |
---|---|
id | INTEGER |
word | VARCHAR |
This time, instead of selecting palindromes, we'll select anagrams. Anagrams are pairs of words where the letters of 1 word can be rearranged into the arrangement of the other word. For example, "state" and "taste" are anagrams because you can rearrange the letters of "state" to spell "taste" and vice versa.
Select all pairs of anagrams from english_words
. Name the columns word_a
and word_b
.
Do not consider a word an anagram of itself, e.g. "state" and "state" are NOT anagrams.
Do not include duplicate pairs, e.g. if your result includes "state" and "taste", do not also include "taste" and "state" transposed.
Always order a pair such that the word which is alphabetically first is word_a
.