This is an age old question and of course the answer depends on how you say “SQL”.
- … a Structured Query Language statement…
- … a Sequel statement…
- … an Es Queue El statement… (I say it this way)
Different people say it different ways. Most of the time I don’t notice, but I just read something by another writer and kept seeing “a SQL …” and it was freaking me out. Then I realised I always write “an SQL …”, which reads “an sequel …” to some people, which sounds really stupid.
According to the Oracle docs it is sequel, so “a SQL …” is the correct way.
“SQL (pronounced sequel) is the set-based, high-level declarative computer language…”
The MySQL docs go the other route.
“The official way to pronounce “MySQL” is “My Ess Que Ell” (not “my sequel”), but we do not mind if you pronounce it as “my sequel” or in some other localized way.”
According to Wikipedia, it doesn’t matter either way.
“The original standard declared that the official pronunciation for “SQL” was an initialism: /ˈɛs kjuː ˈɛl/ (“es queue el”). Regardless, many English-speaking database professionals (including Donald Chamberlin himself) use the acronym-like pronunciation of /ˈsiːkwəl/ (“sequel”), mirroring the language’s pre-release development name of “SEQUEL”
If one of the designers can’t make his mind up, what hope to we have?
Anyway, when you are reading my stuff and you see “an SQL …” everywhere, it’s correct for the way I say SQL.
PS. All the other typos are just plain typos because I’m practically illiterate.
PPS. PL/SQL is a lot simpler as it is “a PL/SQL …” regardless of how you say it.
Update: The general consensus from comments, twitter and emails seems to be:
- When you write it, it should be “a SQL …”, regardless of how you say it. Taking me back to school, Paul Steffensen said, “if it starts with a vowel it’s an, otherwise it’s a”. In my reply, I mentioned that “an Es Queue El …” does start with a vowel. That being said, “a SQL …” goes with the basic written language, the sequel version and the full wording of the acronym, so it fits more of the cases.
- If, like me, you say “Es Queue Ell”, you should probably say “an Es Queue Ell” when speaking, but still write it “a SQL …”
- Andrew Taylor said, “just to be on the safe side I say *some* SQL.” Pure genius!
- In many cases, you can probably reword the statement so the “a” is not necessary. This feels like a cop out, but it might be what I end up doing.