ISO SQL standard - 187 CHF https://www.iso.org/standard/76583.html
ANSI SQL standard - 237 USD for non members https://webstore.ansi.org/standards/iso/isoiec90752016
ISO SQL standard - 187 CHF https://www.iso.org/standard/76583.html
ANSI SQL standard - 237 USD for non members https://webstore.ansi.org/standards/iso/isoiec90752016
It's readable - though obviously you're going to need experience in RDBMS theory (Codd's paper, etc) to grok it.
It is very verbose, though.
Fortunately, the only people who need the ISO SQL spec are the vendors: the people writing SQL engines and tooling: it's next-to-useless for people who are designing databases or writing queries against them, chiefly because no RDBMS implementation, ever, has come close to implementing the full specification, and everyone has their own extensions to SQL - so all the vendors put out their own documentation and the world's largely been happy with that for the past ~40 years that SQL's been relevant.
It's not too hard to find the standards in PDF form if you know where to look - and as someone who does a fair bit of SQL, I'll say I've only ever referred to the standards to back-up my more controversial posts on StackOverflow.
it would be useful to have that standard. Thanks, will have a hunt.
.
6. Aggregate Queries Can Contain Non-Aggregate Result Columns That Are Not In The GROUP BY Clause
For example to find the highest paid employee:
SELECT max(salary), first_name, last_name FROM employee;
.
That's straightforward, no?
max(salary) over(partition by emp, dept order by salary desc) as top_emp
...
where top_emp = 1
(You need to put the window in a subquery)I don’t know exactly where in the spec it’s defined, though - but I’ve seen people say it was introduced in SQL99.