Skip to content

Commit e5528b2

Browse files
Freshness pass.
1 parent aa01782 commit e5528b2

File tree

1 file changed

+23
-24
lines changed

1 file changed

+23
-24
lines changed

articles/cosmos-db/nosql/tutorial-query.md

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
11
---
22
title: 'Tutorial: How to query with SQL in Azure Cosmos DB?'
3-
description: 'Tutorial: Learn how to query with SQL queries in Azure Cosmos DB using the query playground'
3+
description: In this tutorial, learn how to query with SQL queries in Azure Cosmos DB using the query playground.
44
author: seesharprun
55
ms.author: sidandrews
66
ms.reviewer: mjbrown
77
ms.service: cosmos-db
88
ms.subservice: nosql
99
ms.custom: tutorial-develop, mvc, ignite-2022
1010
ms.topic: tutorial
11-
ms.date: 08/26/2021
11+
ms.date: 03/07/2023
1212
---
1313

1414
# Tutorial: Query Azure Cosmos DB by using the API for NoSQL
1515
[!INCLUDE[NoSQL](../includes/appliesto-nosql.md)]
1616

1717
The Azure Cosmos DB [API for NoSQL](../introduction.md) supports querying documents using SQL. This article provides a sample document and two sample SQL queries and results.
1818

19-
This article covers the following tasks:
19+
This article covers the following tasks:
2020

2121
> [!div class="checklist"]
22-
> * Querying data with SQL
22+
> - Query data with SQL
23+
24+
## Prerequisites
25+
26+
This tutorial assumes you have an Azure Cosmos DB account and collection. Don't have any of those resources? Complete this quickstart: [Create an Azure Cosmos DB account, database, container, and items from the Azure portal](quickstart-portal.md).
2327

2428
## Sample document
2529

@@ -56,28 +60,23 @@ The SQL queries in this article use the following sample document.
5660

5761
## Where can I run SQL queries?
5862

59-
You can run queries using the Data Explorer in the Azure portal and via the [REST API and SDKs](sdk-dotnet-v2.md).
63+
You can run queries using the Data Explorer in the Azure portal and by using the [REST API and SDKs](sdk-dotnet-v2.md).
6064

61-
For more information about SQL queries, see:
62-
* [SQL query and SQL syntax](query/getting-started.md)
63-
64-
## Prerequisites
65-
66-
This tutorial assumes you have an Azure Cosmos DB account and collection. Don't have any of those resources? Complete the [5-minute quickstart](quickstart-portal.md).
65+
For more information about SQL queries, see [Getting started with queries](query/getting-started.md).
6766

6867
## Example query 1
6968

70-
Given the sample family document above, following SQL query returns the documents where the ID field matches `WakefieldFamily`. Since it's a `SELECT *` statement, the output of the query is the complete JSON document:
69+
Given the sample family document, following SQL query returns the documents where the ID field matches `WakefieldFamily`. Since it's a `SELECT *` statement, the output of the query is the complete JSON document:
7170

72-
**Query**
71+
Query:
7372

7473
```sql
7574
SELECT *
7675
FROM Families f
7776
WHERE f.id = "WakefieldFamily"
7877
```
7978

80-
**Results**
79+
Results:
8180

8281
```json
8382
{
@@ -112,7 +111,7 @@ Given the sample family document above, following SQL query returns the document
112111

113112
The next query returns all the given names of children in the family whose ID matches `WakefieldFamily`.
114113

115-
**Query**
114+
Query:
116115

117116
```sql
118117
SELECT c.givenName
@@ -121,9 +120,9 @@ The next query returns all the given names of children in the family whose ID ma
121120
WHERE f.id = 'WakefieldFamily'
122121
```
123122

124-
**Results**
123+
Results:
125124

126-
```
125+
```json
127126
[
128127
{
129128
"givenName": "Jesse"
@@ -134,19 +133,19 @@ The next query returns all the given names of children in the family whose ID ma
134133
]
135134
```
136135

136+
In this tutorial, you've done the following tasks:
137+
138+
> [!div class="checklist"]
139+
> - Learned how to query using SQL
137140
138141
## Next steps
139142

140-
In this tutorial, you've done the following tasks:
143+
Want to do capacity planning for a migration to Azure Cosmos DB? You can use information about your existing database cluster for capacity planning.
141144

142-
> [!div class="checklist"]
143-
> * Learned how to query using SQL
145+
- [Convert the number of vCores or vCPUs in your nonrelational database to Azure Cosmos DB RU/s](../convert-vcore-to-request-unit.md)
146+
- [Estimate RU/s using the Azure Cosmos DB capacity planner - API for NoSQL](estimate-ru-with-capacity-planner.md)
144147

145148
You can now proceed to the next tutorial to learn how to distribute your data globally.
146149

147150
> [!div class="nextstepaction"]
148151
> [Distribute your data globally](tutorial-global-distribution.md)
149-
150-
Trying to do capacity planning for a migration to Azure Cosmos DB? You can use information about your existing database cluster for capacity planning.
151-
* If all you know is the number of vcores and servers in your existing database cluster, read about [estimating request units using vCores or vCPUs](../convert-vcore-to-request-unit.md)
152-
* If you know typical request rates for your current database workload, read about [estimating request units using Azure Cosmos DB capacity planner](estimate-ru-with-capacity-planner.md)

0 commit comments

Comments
 (0)