Microsoft Learn

Documentation | Azure Cosmos DB

Azure Cosmos DB SQL API Overview

This document provides a comprehensive overview of the Azure Cosmos DB SQL API, a powerful query interface for interacting with your NoSQL data. It enables you to use familiar SQL syntax to query, insert, update, and delete data stored in Azure Cosmos DB.

Key Concepts

Core Operations with SQL API

You can perform the following operations using the SQL API:

Example SQL Query

Here's a simple example of how to select all products with a price greater than 50:

SELECT VALUE p FROM products p WHERE p.price > 50

Benefits of Using the SQL API

Did you know? The Cosmos DB SQL API is schema-agnostic. It can query JSON documents with varying structures, making it highly flexible for evolving applications.

Getting Started

To start using the Cosmos DB SQL API:

  1. Create an Azure Cosmos DB account and a SQL API database.
  2. Create a container within your database.
  3. Use the Azure portal, Azure CLI, PowerShell, or the Azure Cosmos DB SDKs (available for various languages like .NET, Java, Node.js, Python, and Go) to interact with your data using SQL queries.