Substring function
The capital of Sweden is Stockholm. Both words start with the letter 'S'. The SQLite substr function returns a substring from a string starting at a specified position with a predefined length. The syntax is substr( string, start, length ) If the start is a positive integer, the substr() function returns a substring starting from the beginning of the string. The first character has an index of 1. If the start is a negative integer, the returned substring consists of the length number of character starting from the end of the string. The last character has an index of -1.
Show the name and the capital where the first letters of each match. Don't include countries where the name and the capital are the same word.
SELECT name, capital FROM world WHERE substr(name,1,1) = substr(capital,1,1) AND name!=capital