-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Document queries and joins in YSQL - Doc6849 #7173
Conversation
The doc on queries and joins (for the Explorer section of Yugabyte docs) is ready for review. |
@@ -34,29 +34,28 @@ The following `SELECT` statement clauses provide flexiblity and allow you to fin | |||
- The `DISTINCT` operator allows you to select distinct rows. | |||
- The `ORDER BY` clause lets you sort rows. | |||
- The `WHERE` clause allows you to apply filters to rows. | |||
- The `LIMIT` and `FETCH` clauses allow you to select a subset of rows from a table. | |||
- The `LIMIT` clauses allow you to select a subset of rows from a table. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/clauses allow/clause allows/
Since YSQL is case-sensitive (that is, it treats the same characters differently depending on whether they are uppercase and lowercase), it is important to use correct cases when forming queries. For example, a table called `Employees` would not be recognized as an `employees` table, even if that is what you mean. That is, if your database contains an `employees` table and you want to query it using the following statement, the query execution will result in an error: | ||
|
||
```sql | ||
SELECT name FROM Employees; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I know this section is not quite correct.
Identifiers are normalized to lowercase unless they are quoted.
So, for example:
yugabyte=# create table fOo(iD int PRIMARY KEY);
CREATE TABLE
yugabyte=# select Id from FoO; -- any capitalization works if unquoted
id
----
(0 rows)
yugabyte=# create table "bAr"("iD" int PRIMARY KEY);
CREATE TABLE
yugabyte=# select iD from bAr; -- no capitalization works because identifiers will let lowercased if unquoted
ERROR: relation "bar" does not exist
LINE 1: select iD from bAr;
^
yugabyte=# select "iD" from "bAr"; -- quoting with the same as the declared capitalization will work.
iD
----
(0 rows)
yugabyte=# \d
List of relations
Schema | Name | Type | Owner
--------+------+-------+----------
public | bAr | table | yugabyte
public | foo | table | yugabyte
(2 rows)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed this section
This PR has been "in review" for 7 days. If there are no other comments, then I'm going to merge it today. |
Discussed with Mihnea. Decided to publish the doc and then implement review comments via a new PR. |
* Added content to queries.md * Added content to queries.md * edits * edits * Added content to queries.md and edited _index.md * Changed section title * Implemented Karthik's review comments * Moved some sections; minor edits * Implemented review comments; misc edits * Implemented review comments
No description provided.