Finding countries with a certain character in the name?

Alright,

So I have MySQL Workbench, and the “world” database that comes with it as sample data. Now I have to find all countries that has the letter “W” as the middle character in the land codes in the database.

Like:

SELECT Code (with letter W as middle character)
FROM Country

How could I do this?

Of course, I guess I took for granted that “land codes” are always three characters. :slight_smile:

if it’s a three-character code, yes, that’ll do it

but we didn’t know what size it was, did we, which is why i asked for a SHOW CREATE TABLE

:slight_smile:

homework assignment?

could you please do a SHOW CREATE TABLE for the country table

Home … work? :slight_smile:

I guess it could be done with ‘%W%’ or similar, but thanks anyway.

Solved

SELECT Name, Code
FROM Country
WHERE Code like '_W_'