DBMS, January 1997
DBMS Letters

The Empty Set Debate

In his column, "Summing With SQL" (see DBMS, November 1996, page 20), Joe Celko takes me to task once again -- this time for my claim that the SUM of an empty set should be zero. He says, "This convention [is] known to be formally incorrect," and he cites exercise one of chapter 2, page 62, of Concrete Mathematics, by Graham, Knuth, and Patashnik (Addison-Wesley, 1994) in support of his position. But in their own answer to that very exercise, the authors of Concrete Mathematics refer to "the generally accepted convention that the sum of n values = 0 when n = 0" (slightly reworded, boldface added). They make no mention of the "formal incorrectness" of this convention. I stand by my position.

C.J. Date
Healdsburg, Calif.

The authors also make a point that empty index sets are not defined and that this is strictly a convention. They then have an exercise at the end of that chapter that asks the student to give several interpretations of some "Big Sigma" expressions with index start and stop values that do not define a proper series of cardinal numbers. They then announce which ones they prefer.

Going back to section 1.2.3, "Sums and Products," exercise 23 of Knuth's The Art of Computer Programming, Vol. 1, "Fundamental Algorithms" (Addison-Wesley, 1973), the author asks the student to explain why it is a good idea to define the summation and product of an operator with an empty set as zero and one respectively.
-- Joe Celko

IBM DB2

I have just finished reading Natalie van der Walt's article about IBM's DB2. (See DBMS, November 1996, page S27.) I am interested in the product for our use here at the University of Arkansas for Medical Sciences. We have an IBM mainframe and about 90 host servers located on this campus. The servers in our office are running Windows NT and we would like to have access to the data on the mainframe.

I enjoyed the article and I hope it will put me on the right track to convincing our folks to use a product such as DB2 to decentralize our mainframe data.

Ralph Tillery
rtillery@mail.uams.edu

Due Diligence

I have a comment on Judith Hurwitz's column "New Hula Hoops and Other Trends." (See DBMS, October 1996, page 14.) Right on! I could not agree with her more. It seems as if every week I hear another presentation by an Internet company saying how the Internet will solve all of the data access problems and will reduce development from the client/server paradigm of three-to-six months to a few weeks. Hearing such proposals doesn't bother me as much as seeing senior managers at firms sit and listen unquestioning.

It all reminds me of a consulting company that told a customer that there is no need for requirements, design, and testing: This is client/server, and we can do it all right in front of you. Needless to say, shortly after that the consulting firm changed its deliver schedule -- they increased it by six months and eventually got kicked out of the project for failure to deliver what was asked.

It seems as if everyone is looking for a magic solution to good old-fashioned diligence. Keep the faith!

Fred Lengerich
Sybase Inc.

(The views expressed in the above letter are those of the writer and do not necessarily reflect the views of Sybase.)

Readers' Choice Companies

Contact information for the following Readers' Choice winning companies did not appear in the company contact list on page 48 of the December DBMS: DBMS regrets the omissions.

Microsoft SQL Server Correction

In the November 1996 issue of DBMS, Martin Rennhackkamp's DBMS server comparison (see "Comparison Summary," page S4) contains an important error regarding ANSI syntax joins that we would like to see corrected. The table on pages S10 and S11 lists "No" under "Queries, ANSI syntax." On page S8, the author makes the comment, "Although all of the products have some variation of the outer join operation, only CA-OpenIngres supports the correct ANSI SQL-92 standard syntax." Neither of these statements is correct.

Our manual "What's New in SQL Server 6.5," which comes with the 6.5 software package, discusses our support for ANSI-standard join clauses on page 155 under "Joins" and under the SELECT statement on page 216. On page 219, the manual states, "The following types of ANSI joins are permitted: CROSS JOIN, INNER, LEFT OUTER, RIGHT OUTER, FULL OUTER. Cor Winckler wrote the individual review of SQL Server 6.5 for the same DBMS issue; on page S26, he says, "A new addition in version 6.5 is the ANSI SQL syntax for full and partial outer joins."

There is also a problem in Rennhackkamp's October 1996 column in DBMS. (See "Performance Tuning," page 85.) Rennhackkamp chides us for not having as many tuning "knobs" as databases such as Oracle and Sybase. He then failed to mention any of our sophisticated tuning parameters such as optimizer hints, pinned tables, and CPU affinity mask. He specifically refers to "SQL Server 6.5" in the article, but his information seems to come from SQL Server 4.2. SQL Server 6.5 supports an extensive list of tuning parameters, including many more than the article listed.

Tom Kreyche
Microsoft Corp.

DBMS apologizes for these errors. SQL Server 6.5 does support the ANSI outer join syntax. And Microsoft SQL Server 6.5 and 6.0 (the version that followed 4.2) did introduce many new tuning parameters.
-- Ed.

Caption Correction

In Ken North's November 1996 DBMS article (see "Database Programming with OLE and ActiveX," page 87), an incorrect caption was printed for Figure 2 on page 90. The correct caption is: "OLE DB programmers instantiate a data source before creating a DBSession object. They use the DBSession's IOpenRowset interface to create a Rowset instance." DBMS apologizes for the error.

Salary Solution

I use Oracle and came up with a solution for Joe Celko's salary puzzle. (See DBMS, September 1996, page 22.) I didn't need any views or unions. After creating the table and inserting the rows, I queried the table with the information in Listing 1.

The first line of the where clause establishes the OUTER JOIN. This may not be a "proper" OUTER JOIN, but the (+) is Oracle's implementation of one. The first subquery limits s0.sal_date to the most recent sal_date for an employee. The second subquery limits s1.sal_date to the next most recent sal_date for the same employee by excluding the sal_date that matches s0.sal_date. If there is no second sal_date for an employee, then the null values of the outer join are used.

Thomas E. Berendt
Statistics of Income, IRS
Ogden, Utah



LISTING 1

select s0.emp emp, s0.sal_date sal_date, s0.sal_amt sal_amt, s1.sal_date sal_date,
s1.sal_amt sal_amt
from salaries s0, salaries s1
where s0.emp = s1.emp(+) and s0.sal_date != s1.sal_date(+)
and s0.sal_date =
(select max(sal_date) from salaries where emp = s0.emp)
and (s1.sal_date =
(select max(sal_date) from salaries where emp = s0.emp and sal_date != s0.sal_date) 
or s1.sal_date is null);
EMP SAL_DATE SAL_AMT SAL_DATE SAL_AMT
Tom 1996-12-209001996-10-20800
Harry 1996-09-207001996-07-20500
Dick1996-06-20500(null)(null)


Subscribe to DBMS and Internet Systems -- It's free for qualified readers in the United States
January 1997 Table of Contents | Other Contents | Article Index | Search | Site Index | Home

DBMS and Internet Systems (http://www.dbmsmag.com)
Copyright © 1997 Miller Freeman, Inc. ALL RIGHTS RESERVED
Redistribution without permission is prohibited.
Please send questions or comments to dbms@mfi.com
Updated Friday, December 13, 1996.