Skip to content

Commit f6e2a91

Browse files
committed
fix few typos
1 parent e552e9b commit f6e2a91

File tree

3 files changed

+28
-26
lines changed

3 files changed

+28
-26
lines changed

articles/cosmos-db/sql-query-from.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ description: Learn about the SQL syntax, and example for FROM clause for Azure C
44
author: timsander1
55
ms.service: cosmos-db
66
ms.topic: conceptual
7-
ms.date: 12/02/2019
7+
ms.date: -5/08/2020
88
ms.author: tisande
99

1010
---
1111
# FROM clause in Azure Cosmos DB
1212

1313
The FROM (`FROM <from_specification>`) clause is optional, unless the source is filtered or projected later in the query. A query like `SELECT * FROM Families` enumerates over the entire `Families` container. You can also use the special identifier ROOT for the container instead of using the container name.
1414

15-
The FROM clause enforces the following rules per query:
15+
The `FROM` clause enforces the following rules per query:
1616

17-
* The container can be aliased, such as `SELECT f.id FROM Families AS f` or simply `SELECT f.id FROM Families f`. Here `f` is the alias for `Families`. AS is an optional keyword to [alias](sql-query-aliasing.md) the identifier.
17+
* The container can be aliased, such as `SELECT f.id FROM Families AS f` or simply `SELECT f.id FROM Families f`. Here `f` is the alias for `Families`. AS is an optional keyword to [alias](sql-query-working-with-json.md#aliasing) the identifier.
1818

1919
* Once aliased, the original source name cannot be bound. For example, `SELECT Families.id FROM Families f` is syntactically invalid because the identifier `Families` has been aliased and can't be resolved anymore.
2020

@@ -25,15 +25,15 @@ The FROM clause enforces the following rules per query:
2525
```sql
2626
FROM <from_specification>
2727

28-
<from_specification> ::=
28+
<from_specification> ::=
2929
<from_source> {[ JOIN <from_source>][,...n]}
3030

31-
<from_source> ::=
31+
<from_source> ::=
3232
<container_expression> [[AS] input_alias]
3333
| input_alias IN <container_expression>
3434

35-
<container_expression> ::=
36-
ROOT
35+
<container_expression> ::=
36+
ROOT
3737
| container_name
3838
| input_alias
3939
| <container_expression> '.' property_name
@@ -46,9 +46,9 @@ FROM <from_specification>
4646

4747
Specifies a data source, with or without an alias. If alias is not specified, it will be inferred from the `<container_expression>` using following rules:
4848

49-
- If the expression is a container_name, then container_name will be used as an alias.
49+
- If the expression is a container_name, then container_name will be used as an alias.
5050

51-
- If the expression is `<container_expression>`, then property_name, then property_name will be used as an alias. If the expression is a container_name, then container_name will be used as an alias.
51+
- If the expression is `<container_expression>`, then property_name, then property_name will be used as an alias. If the expression is a container_name, then container_name will be used as an alias.
5252

5353
- AS `input_alias`
5454

@@ -94,9 +94,9 @@ If a container expression accesses properties or array elements and that value d
9494

9595
A container expression may be container-scoped or document-scoped:
9696

97-
- An expression is container-scoped, if the underlying source of the container expression is either ROOT or `container_name`. Such an expression represents a set of documents retrieved from the container directly, and is not dependent on the processing of other container expressions.
97+
- An expression is container-scoped, if the underlying source of the container expression is either ROOT or `container_name`. Such an expression represents a set of documents retrieved from the container directly, and is not dependent on the processing of other container expressions.
9898

99-
- An expression is document-scoped, if the underlying source of the container expression is `input_alias` introduced earlier in the query. Such an expression represents a set of documents obtained by evaluating the container expression in the scope of each document belonging to the set associated with the aliased container. The resulting set will be a union of sets obtained by evaluating the container expression for each of the documents in the underlying set.
99+
- An expression is document-scoped, if the underlying source of the container expression is `input_alias` introduced earlier in the query. Such an expression represents a set of documents obtained by evaluating the container expression in the scope of each document belonging to the set associated with the aliased container. The resulting set will be a union of sets obtained by evaluating the container expression for each of the documents in the underlying set.
100100

101101
## Examples
102102

@@ -142,7 +142,7 @@ The results are:
142142
]
143143
```
144144

145-
The preceding query used an array as the source, but you can also use an object as the source. The query considers any valid, defined JSON value in the source for inclusion in the result. The following example would exclude `Families` that dont have an `address.state` value.
145+
The preceding query used an array as the source, but you can also use an object as the source. The query considers any valid, defined JSON value in the source for inclusion in the result. The following example would exclude `Families` that don't have an `address.state` value.
146146

147147
```sql
148148
SELECT *

articles/cosmos-db/sql-query-select.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ms.author: tisande
1010

1111
# SELECT clause in Azure Cosmos DB
1212

13-
Every query consists of a SELECT clause and optional [FROM](sql-query-from.md) and [WHERE](sql-query-where.md) clauses, per ANSI SQL standards. Typically, the source in the FROM clause is enumerated, and the WHERE clause applies a filter on the source to retrieve a subset of JSON items. The SELECT clause then projects the requested JSON values in the select list.
13+
Every query consists of a `SELECT` clause and optional [FROM](sql-query-from.md) and [WHERE](sql-query-where.md) clauses, per ANSI SQL standards. Typically, the source in the `FROM` clause is enumerated, and the `WHERE` clause applies a filter on the source to retrieve a subset of JSON items. The `SELECT` clause then projects the requested JSON values in the select list.
1414

1515
## Syntax
1616

@@ -24,7 +24,6 @@ SELECT <select_specification>
2424

2525
<object_property_list> ::=
2626
{ <scalar_expression> [ [ AS ] property_alias ] } [ ,...n ]
27-
2827
```
2928

3029
## Arguments

articles/cosmos-db/sql-query-working-with-json.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ ms.date: 05/08/2020
88
ms.author: tisande
99
---
1010

11+
# Working with JSON in Azure Cosmos DB
12+
1113
In Azure Cosmos DB's SQL (Core) API, items are stored as JSON. The type system and expressions are restricted to deal only with JSON types. For more information, see the [JSON specification](https://www.json.org/).
1214

1315
We'll summarize some important aspects of working with JSON.
14-
- JSON objects always begin with a `{` left brace and end with a `}` right brace
15-
- You can have JSON properties [nested](#nested-properties) within one another
16-
- JSON properties can have arrays values
17-
- JSON properties are case sensitive
18-
- JSON properties can have any string value (including spaces or characters that aren't letters)
16+
17+
- JSON objects always begin with a `{` left brace and end with a `}` right brace
18+
- You can have JSON properties [nested](#nested-properties) within one another
19+
- JSON properties can have arrays values
20+
- JSON properties are case sensitive
21+
- JSON properties can have any string value (including spaces or characters that aren't letters)
1922

2023
## Nested properties
2124

@@ -39,7 +42,7 @@ Here's a document with nested JSON:
3942

4043
In this case, the `state`, `country`, and `city` properties are all nested within the `address` property.
4144

42-
The following example projects two nested properties, `f.address.state` and `f.address.city`.
45+
The following example projects two nested properties: `f.address.state` and `f.address.city`.
4346

4447
```sql
4548
SELECT f.address.state, f.address.city
@@ -90,7 +93,7 @@ FROM Families f
9093
WHERE f.children[0].givenName = "Jesse"
9194
```
9295

93-
In most cases however, you'll use a [subquery](sql-query-subquery.md) or [self-join](sql-query-join.md) when working with arrays.
96+
In most cases, however, you'll use a [subquery](sql-query-subquery.md) or [self-join](sql-query-join.md) when working with arrays.
9497

9598
For example, here's a document that shows the bank account balance of a customer over each month during 2020.
9699

@@ -119,7 +122,7 @@ For example, here's a document that shows the bank account balance of a customer
119122
}
120123
```
121124

122-
If you wanted to run a query that showed all the customers that had a negative balance at some point during 2020, it would use [EXISTS](sql-query-subquery.md#exists-expression) with a subquery and look like this:
125+
If you wanted to run a query that showed all the customers that had a negative balance at some point during 2020, it would use [EXISTS](sql-query-subquery.md#exists-expression) with a subquery:
123126

124127
```sql
125128
SELECT c.id
@@ -133,7 +136,7 @@ WHERE EXISTS(
133136

134137
## Reserved keywords and special characters in JSON
135138

136-
You can access properties using the quoted property operator []. For example, `SELECT c.grade` and `SELECT c["grade"]` are equivalent. This syntax is useful to escape a property that contains spaces, special characters, or has the same name as a SQL keyword or reserved word.
139+
You can access properties using the quoted property operator `[]`. For example, `SELECT c.grade` and `SELECT c["grade"]` are equivalent. This syntax is useful to escape a property that contains spaces, special characters, or has the same name as a SQL keyword or reserved word.
137140

138141
For example, here's a document with a property named `order` and a property `price($)` that contains special characters:
139142

@@ -229,7 +232,7 @@ You can explicitly alias values in queries. If a query has two properties with t
229232

230233
### Examples
231234

232-
The AS keyword used for aliasing is optional, as shown in the following example when projecting the second value as `NameInfo`:
235+
The `AS` keyword used for aliasing is optional, as shown in the following example when projecting the second value as `NameInfo`:
233236

234237
```sql
235238
SELECT
@@ -253,7 +256,7 @@ The results are:
253256
}]
254257
```
255258

256-
You can't use alias to project a value as a property name with a space, special character, or reserved word. If you wanted to change a value's projection to, for example, have a property name with a space, you could use a [JSON expression](#json-expressions).
259+
You can't use aliasing to project a value as a property name with a space, special character, or reserved word. If you wanted to change a value's projection to, for example, have a property name with a space, you could use a [JSON expression](#json-expressions).
257260

258261
Here's an example:
259262

@@ -268,5 +271,5 @@ Here's an example:
268271
## Next steps
269272

270273
- [Getting started](sql-query-getting-started.md)
271-
- [Azure Cosmos DB .NET samples](https://github.com/Azure/azure-cosmos-dotnet-v3)
274+
- [SELECT clause](sql-query-select.md)
272275
- [WHERE clause](sql-query-where.md)

0 commit comments

Comments
 (0)