5 ms·
Quoting the SQLite docs: The SQL standard specifies a large number of keywords which may not be used as the names of tables, indices, columns, databases, use
by em500 3y ago
Quoting the SQLite docs:
The SQL standard specifies a large number of keywords which may not be used as the names of tables, indices, columns, databases, user-defined functions, collations, virtual table modules, or any other named object. The list of keywords is so long that few people can remember them all. For most SQL code, your safest bet is to never use any English language word as the name of a user-defined object.
https://www.sqlite.org/lang_keywords.html https://www.sqlite.org/lang_keywords.html
- masklinn 3y agoFor increased complexity, SQL actually has two kinds of keywords, reserved and non-reserved, non-reserved is what some grammars call contextual or lexical keywords: they are only keywords in specific contexts, but are generally usable as unquoted identifiers. And obviously this is only for maximally portable SQL, postgres has a comparative table, which demonstrates that many of SQL's reserved keywords are non-reserved in postgres-sql: https://www.postgresql.org/docs/current/sql-keywords-appendix.html https://www.postgresql.org/docs/current/sql-keywords-appendi...
- stronglikedan 3y agoThis is exactly why I prefer to use the plural forms for table names, despite the debate.
- munk-a 3y agoCurse you - it's an apple collection not a collection of apples! I loathe plurality in table names because it's hard for ESL developers due to the plethora of irregular pluralities (like the word pluralities) in english. If object/entity names and table names are both singular you can do a lot of stuff on autopilot.
- kreeben 3y agoElectronic Sports League? Anywho, I agree, you see: "It puts the lotion in the basket" See? Not a plural in sight!
- munk-a 3y agoSorry ESL here is "English as a Second Language" - or non-native english speakers. Our company has a diverse set of employees and only about 60% of us have English as our native language.
- funcDropShadow 3y agoThen enable a spell checker in the editor / ide in which you write your SQL. Not being a native speaker should never be used as an argument against proper naming and wording of code and or documentation. I am not a native English speaker as well. As pointed out by other replies to your comment. Abbreviations can lead to similar problems even with native speakers.
- eimrine 3y agoThe most strange word in this short list is "vacuum", what SQL ideas might be expressed with this word?
- wrayjustin 3y agohttps://www.sqlite.org/lang_vacuum.html https://www.sqlite.org/lang_vacuum.html
- masklinn 3y agoAnd https://www.postgresql.org/docs/current/sql-vacuum.html https://www.postgresql.org/docs/current/sql-vacuum.html
- saurik 3y agoThat "don't use english words" is somehow the recommendation instead of "always quote identifiers" feels a bit ridiculous.
- nsxwolf 3y agoI think it is a joke.
- deleted 3y ago[deleted]
- paulddraper 3y agoThat's like saying "bash specifies a large number of character patterns which may not be used as arguments." No. It just requires they be quoted. --- The SQL standard forbids certain "regular identifiers," however it places no such restriction of "delimited identifiers." I.e. use quotes.