The % is a wild-card it can match any characters
Find the country that start with Y
select name from world
where name like 'y%'
select name from world
where name like '%y'
Find the countries that contain the letter x
select name from world
where name like '%x%'
Find the countries that end with land
select name from world
where name like '%land'
Find the countries that start with C and end with ia
select name from world
where name like 'c%ia'
Find the country that has oo in the name
select name from world
where name like '%oo%'
Find the countries that have three or more a in the name
select name from world
where name like '%a%a%a%'
SELECT name FROM world
WHERE name LIKE '_n%'
ORDER BY name
Find the countries that have "t" as the second character.
select name from world
where name like '_t%'
Find the countries that have two "o" characters separated by two others.
select name from world
where name like '%o__o%'
Find the countries that have exactly four characters.
select name from world
where name like '____'
Find the country where the name is the capital city.
select name from world
where name = capital
Find the country where the capital is the country plus "City".
SELECT name FROM world
where capital = concat(name, ' city')
SELECT name, capital FROM world
WHERE capital LIKE CONCAT(name,'%')
You should include Mexico City as it is longer than Mexico. You should not include Luxembourg as the capital is the same as the country.
SELECT capital, name FROM world
WHERE capital LIKE concat(name,'%') AND capital != name
Show the name and the extension where the capital is an extension of name of the country.
You can use the SQL function REPLACE.
SELECT name, REPLACE(capital,name,'') FROM world
WHERE capital LIKE CONCAT('%',name,'%') AND name != capital;