Book

Table of Contents

Example Query

Of course, most of the time you need to read data. So let’s focus now on queries for selecting data.

Simple database queries can be made even by a person far from programming. For example, the following query should be understandable to anyone with basic English skills:

SELECT name
FROM cities
WHERE region_code = 42

SELECT name
FROM all cities
WHERE region code equals 42 (Kemerovo region)

The result of the query will be a list of cities in Kemerovo region.