Clause vs Command vs Keyword confusion
singlarohit opened this issue · 3 comments
I have a general but important issue to discuss. I checked all the episodes of SQL Ecology lesson, and I noticed that the term "command" , "clause" and "keyword" are used interchangeably throughout the episodes 2, 3 and 4 of the lesson. I believe that only one term (preferably "clause") must be used to avoid any confusion to the readers. Some of the examples are below:
- In the second episode (Accessing Data with Queries) "command" is used for LIMIT clause
- In the third episode (Aggregating and Grouping Data) "command" is used for COUNT clause is used twice.
- In the fourth and final episode (Combining data with joins) "command" is used for JOIN and FROM clauses
Also "keyword" is used many times. Because SQL comes from the field of Computer science, I believe that use of "clause" is more appropriate in this context. I strongly feel that the above occurrences of "command" and "keyword" must be changed with "clause" to maintain consistency in the lesson. Alternatively, attendees/readers may be familiarized with these words in the beginning of the lesson, so they know what to expect.
Hi, thanks for bringing up an issue that may cause confusion for people.
I see that you've also made a PR for this (#347).
The first thing to consider is whether those three terms are interchangeable, and the second thing would be to consider whether the right term is used in each context.
On the first aspect, a "command" is commonly used in computer science to mean a whole instruction provided to the computer to interpret. This is typical of imperative programming, and SQL is a declarative language by design, so using the word "command" does seem out of place. The equivalent in SQL is a "statement".
So I would agree that it should be replaced in most or all instances here by another more appropriate word, and "keyword" stands as the likely replacement.
The reason I think "keyword" fits more often is that, in the computer science context, "keyword" has the technical meaning of a reserved word that is part of the programming language. So the example given in episode 3,
In fact the
JOIN
command is simply shorthand forINNER JOIN
should read
"In fact the JOIN
keyword is simply shorthand for INNER JOIN
"
since JOIN
is part of the SQL specification.
On the other hand, I agree there are places where "clause" is the better fit. Again, "clause" has a technical meaning in SQL, and refers to a subunit of a "statement". You can see how the SQLite documentation uses that to refer to parts of the statement that follow WITH
.
Here is an example from episode 2,
In that case, you can use the
LIMIT
command.
should be "In that case, you can use a LIMIT
clause."
So the take-away message is that I think we should change uses of "command", but there are instances where "clause" is better and "keyword" is better.