Ctr

Anagrams

Remember the english_words table from the Palindromes challenge?


english_words
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.

© 2022 Andrew Carlson. All rights reserved.

word_a
VARCHAR
word_b
VARCHAR
1
act
cat
2
below
elbow
3
bored
robed
4
cheap
peach
5
chin
inch
6
dreads
sadder
7
parsley
players
7 rows

You haven't solved this challenge yet!
Are you sure you want to reveal the answer?