weebkun
weebkun

Reputation: 29

why does sql use single quotes for string literals but other programming languages use double quotes?

im currently studying IT and my lecturer just explained that in the ANSI standard for SQL, single quotes are used for strings. just wondering where this standard came from and why it is different from other languages.

Upvotes: 1

Views: 119

Answers (2)

Leszek Mazur
Leszek Mazur

Reputation: 2531

It is because double quotes is reserved for names literals like "My strange name database"."my other name schema"."my even other name table"."also column name". Authors included that is more natural to use " for name literals and SQL is designed to be as natural language as possible.
In other hand many programming languages use ' for string literals.

Upvotes: 2

greg-tumolo
greg-tumolo

Reputation: 696

That may be because typing ' is easier than typing SHIFT+'.

Upvotes: 1

Related Questions