Page 2: Trino Basic Queries and Data Types

2. Trino Basic Queries and Data Types

Trino is based on standard SQL but has specific characteristics as a distributed query engine. Let's explore common SQL statements and the primary data types supported by Trino.

2.1. Basic SELECT Queries

This is the most fundamental data retrieval query. This example queries all columns from the tpch.tiny.nation table.

SELECT *
FROM tpch.tiny.nation
LIMIT 10;

Key Concept: Trino refers to tables in the format catalog.schema.table. tpch is an example catalog built into Trino.

2.2. Filtering Data (WHERE Clause)

You can use the WHERE clause to select only rows that meet specific conditions.

SELECT name, regionkey
FROM tpch.tiny.nation
WHERE regionkey = 0;

2.3. Trino Data Types

Trino supports a wide range of SQL data types. Common data types include: