with occasional pedestrian SQL topics
Counting (32 pages)
Integer Generators (24 pages)
Exotic Operators (40 pages)
Constraints (19 pages)
Trees (39 pages)
Graphs (41 pages)
I disagree that Relational Division comes once in a lifetime. I use it all the time for reports that look for “shopping basket” patterns in sales data.
Вадим, огромное спасибо за отличную книгу!!!
С уважением, Михаил.
в ссылке на вторую главу есть маленькая опечатка (pdff вместо pdf)
еще раз спасибо за книгу!!!!!!
Hi Vadim, a thread on another forum has mentioned an exotic operator you don’t include:
SQL’s UNION CORRESPONDING seems to be the same as the RL’s inner union.
(Hugh Darwen says that this operator was available in ISBL/BS12, called plain UNION. So not the same as SQL’s plain UNION.)
I don’t see any evidence that anybody realised this operation is the inverse of Nat Join.
I was not aware of UNION CORRESPONDING, thank you!
Just bought your book and reading chapter 1 counting. I have a minor quibble about the scalar subquery corresponding to the predecessor example
I ran your examples on the northwind sample database using the web interface on w3 schools http://www.w3schools.com/sql/trysql.asp?filename=trysql_select_all
and replaced their query versions of your example queries on their database. It worked a treat. But my version of the scalar subquery
SELECT t.ContactName t, t.CustomerID id,
(SELECT count(*) from Customers tt WHERE tt.CustomerID < t.CustomerId) seq
FROM Customers t
GROUP BY t.CustomerID
is not exactly the same query as you gave – no #, and <= is replaced with <
But it also return zero as a result which did not occur in my version of the predecessor query
SELECT t.ContactName t, t.CustomerID id, Max(tt.CustomerID) predecessor FROM Customers t, Customers tt WHERE tt.CustomerID < t.CustomerID
GROUP BY t.CustomerID
Fill in your details below or click an icon to log in:
You are commenting using your WordPress.com account. ( Log Out / Change )
You are commenting using your Twitter account. ( Log Out / Change )
You are commenting using your Facebook account. ( Log Out / Change )
You are commenting using your Google+ account. ( Log Out / Change )
Connecting to %s
Notify me of new comments via email.