[[saiUsingCollectionsListExamples]]
= Using the list type

This example uses the following table and index:

[source,sql]
----
include::cassandra:example$CQL/sai/upcoming_calendar-table.cql[tag=listColumn]
include::cassandra:example$CQL/sai/index-sai-from-list-match.cql[]
----

An index is created on the list column `events` in the `upcoming_calendar` table.

Query with `CONTAINS` from the list `events` column:

[tabs]
====
CQL::
+
--
[source,language-cql]
----
include::cassandra:example$CQL/sai/index-sai-select-from-list.cql[]
----
--

Result::
+
--
[source,console]
----
include::cassandra:example$RESULTS/sai/index-sai-select-from-list.result[]
----
--
====

A slightly more complex query selects rows that either contain a particular event or have a particular month date:

[tabs]
====
CQL::
+
--
[source,language-cql]
----
include::cassandra:example$CQL/sai/index-sai-select-from-list-two-columns.cql[]
----
--

Result::
+
--
[source,console]
----
include::cassandra:example$RESULTS/sai/index-sai-select-from-list-two-columns.result[]
----
--
====