Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update db-query-builder.md #8536

Merged
merged 1 commit into from
May 24, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update db-query-builder.md
Minor grammatical corrections
  • Loading branch information
sprynt committed May 24, 2015
commit 1332cdad99e1959d75390478cf581c96df96aecb
12 changes: 6 additions & 6 deletions docs/guide/db-query-builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Query Builder
=============

Built on top of [Database Access Objects](db-dao.md), query builder allows you to construct a SQL statement
in a programmatic and DBMS-agnostic way. Compared to writing raw SQLs, using query builder will help you write
in a programmatic and DBMS-agnostic way. Compared to writing raw SQL statements, using query builder will help you write
more readable SQL-related code and generate more secure SQL statements.

Using query builder usually involves two steps:
Expand Down Expand Up @@ -61,7 +61,7 @@ $query->select(['id', 'email']);
$query->select('id, email');
```

The column names being selected may include table prefixes and/or column aliases, like you do when writing raw SQLs.
The column names being selected may include table prefixes and/or column aliases, like you do when writing raw SQL statements.
For example,

```php
Expand Down Expand Up @@ -124,7 +124,7 @@ $query->from('user');
```

You can specify the table(s) being selected from in either a string or an array. The table names may contain
schema prefixes and/or table aliases, like you do when writing raw SQLs. For example,
schema prefixes and/or table aliases, like you do when writing raw SQL statements. For example,

```php
$query->from(['public.user u', 'public.post p']);
Expand Down Expand Up @@ -353,7 +353,7 @@ In the above code, the array keys are column names while the array values are th
The PHP constant `SORT_ASC` specifies ascending sort and `SORT_DESC` descending sort.

If `ORDER BY` only involves simple column names, you can specify it using a string, just like you do when writing
raw SQLs. For example,
raw SQL statements. For example,

```php
$query->orderBy('id ASC, name DESC');
Expand All @@ -380,7 +380,7 @@ $query->groupBy(['id', 'status']);
```

If `GROUP BY` only involves simple column names, you can specify it using a string, just like you do when writing
raw SQLs. For example,
raw SQL statements. For example,

```php
$query->groupBy('id, status');
Expand Down Expand Up @@ -607,7 +607,7 @@ value which will be used as the index value for the current row.

When working with large amounts of data, methods such as [[yii\db\Query::all()]] are not suitable
because they require loading all data into the memory. To keep the memory requirement low, Yii
provides the so-called batch query support. A batch query makes uses of the data cursor and fetches
provides the so-called batch query support. A batch query makes use of the data cursor and fetches
data in batches.

Batch query can be used like the following:
Expand Down