content_image/809484.jpg content_image/809485.jpg
## Filter Searches 

| 4079 | Rafah | PSE | Rafah |{"Population": 92020} | +------+------- ----+-------------+------------+-------------------------+ 4082 rows in set (0.01 sec) 

An empty set (no matching records) returns the following information: 

Empty set (0.00 sec) 

To issue a query that returns a set of table columns, use the select()  method and specify the columns to return between square brackets. This query returns the Name and CountryCode columns from the city table. 

<img src='content_image/809484.jpg'>

To issue a query that returns rows matching specific search conditions, use the where()  method to include those conditions. For example, the following example returns the names and country codes of the cities that start with the letter Z. 

<img src='content_image/809485.jpg'>

You can separate a value from the search condition by using the bind()  method. For example, instead of using "Name = ’Z%’ " as the condition, substitute a named placeholder consisting of a colon followed by a name that begins with a letter, such as name . Then include the placeholder and value in the bind() method as follows: 

mysql-py> db.city.select(["Name", "CountryCode"]).where( "Name like :name").bind("name", "Z%") 

