Posts Tagged ‘sql faqs’

Find the capital and the name where the capital includes the name of the country

Answer:   SELECT name,capital ¬†ROM world¬†WHERE capital LIKE concat(concat(‘%’,name),’%’)

Find the countries that have exactly four characters.?

Answer: SELECT name FROM world WHERE length(name) = 4

Find the countries that have two “o” characters separated by two others.

answer: SELECT name FROM world WHERE name LIKE ‘%O__O%’;

Powered by k2schools