Errata

Learning SQL on SQL Server 2005

Errata for Learning SQL on SQL Server 2005

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page xiii
Last line of page, 3rd word.

Says MySQL -- The book is not a MySQL book.

Anonymous   
Printed Page xiv
6th line, 6th word

Says MySQL -- The book is not a MySQL book.

Anonymous   
Printed Page 4
Figure 1-5

Initial Size (MB) is 2. However SQl server 2005 won't let you create a database less than 3 mb of the initial size.

How comes that the figure states 2 mb?

Anonymous   
Printed Page 12
4th para

The sentence "Make sure that the Student_course database is active." should also
include highlighting the table icon.

Anonymous   
Printed Page 19
Code example after 3rd para and 1st line of the 4th para

Both say: USE Student

Should be: USE Student_course

Anonymous   
Printed Page 22
2nd paragraph

To the best of my information CRYSTAL REPORTS does NOT come included with SQL SERVER
2005.

2nd to last sentence states that it is included with SQL Server.

Anonymous   
Printed Page 23
1st para

To open the Crystal Report created on page 22 with "Saving Results to File".

Page 23 1st paragraph states that you can just open the file to view it. If you have not purchased and installed Crystal
Reports on your computer this will not function at all.

Anonymous   
Printed Page 25
Under heading 'Exercises' - first question

The table name 'Department' should be 'Department_to_major'

Anonymous   
Printed Page 26
End of Second paragraph

.... (as shown in Figures 1-26 and 1-28 of Chapter 1).
Should be Figures 1-25 and 1-27 respectively.

Anonymous   
Printed Page 29
3rd paragraph

You state: "Now, right-click on the Dependent table and click Columns, and you will
see the table definition of the Dependent table."

Right-clicking on the Dependent table (or any other table) does not show an option
called "Columns".

Anonymous   
Printed Page 29
3rd paragraph

This paragraph just plain does not work.
It should read," Left click the PLUS sign next to Table name you wish to see the column information of. This expands the
table information. Left click the PLUS sign next to the item named Columns to expand the defined columns for the table"

Anonymous   
Printed Page 29
Paragraph 3,

Whole paragraph is incorrect becuase actions cannot be performed that are being asked. Right clicking on the table does
not give the option to click "Columns" as specified.

Expanding the Table and then expanding Columns sub-node will show the column definitions for that table. Right clicking
on the table and selecting Design will also show the column definitions.

Anonymous   
Printed Page 29
Figure 2-1

The screen shot displays a KEY symbol for the PNO field. The table has no keys assigned at this point in the book.

Anonymous   
Printed Page 29
last paragraph last sentence

The book states: "The only field in the Dependent table that cannot be null is
STNO."

The dependent table does not have an STNO column (field). STNO should be PNO.

Also in Figure 2-1, there is no explanation of what PK means in the PNO field. While
this is probably covered in later chapters, everything else in that figure is
explained in the text above but that single item.

Anonymous   
Printed Page 33,36,37,40,41
Whole pages

The pages I have listed all have shadows around the text. It is obviously a
problem with the printing.

Anonymous   
Printed Page 43
second select statement

on page 43 the select statement is

Select dname, age
From Dependent
Where age
NOT BETWEEN 3 and 15

on page 44, it says the "previous NOT BETWEEN query could also be written as
follows:"

Select sname, class
From Student
Where class < 1
or class > 3

The two queries are not equivalent.

Anonymous   
Printed Page 44
1st paragraph

Example of Not Between coudl also be written as, is incorrect

should read:

SELECT sname, class
FROM Student
WHERE class <=2
OR class =>16

Anonymous  Feb 22, 2010 
Printed Page 51
3RD line on the page

Table1.FieldA should be TableA.Field1

Anonymous   
Printed Page 52 and 53
5th para pg. 52

The changes made by creating a table SYNONYM will not be visible until you right click on the database name,
Student_course, and from the pop up menu select the item named REFRESH. This updates the current Object Explorer View to
reflect the latest changes.
The same procedure applies to pg.53 and the DROP of the SYNONYM.

Anonymous   
Printed Page 56
Section heading EXERCISES

Is there a section with the TIPS or ANSWERS to these exercises and review questions somewhere in this book?
I do not see them in the Appendix.
Otherwise, what's the point?

Anonymous   
Printed Page 57
Exercide 15.

Unless you know which numbers in the student table class column refer to Sophomores, juniors or seniors this exercise
cannot be accomplished properly. Being British I had never come across the term Sophomores before and had to look it up
to know it meant 2nd grade or 2 in the student table class column.

Anonymous   
Printed Page 66
Paragraph beneath Figure 3-1

The context menu item to select should be "Design", not "Modify", in order to see the table definition.

Anonymous   
Printed Page 91
Last paragraph

The text reads "Joins with comparison (non-equal) operators - that is, =, >, >=, <, <=, and <> ...". I don't understand
the meaning of "non-equal" here. It seems this is suggesting that all non-equal operators are the ones in view, but the
equal operator (=) isn't a non-equal operator.

Anonymous   
Printed Page 103
Question 2.b

In question 2.b on pg. 103, it suggests that the table T2 must have different descriptions for each row. For the
following:

T1
---
'Bob', 1
'Sam', 2
'Bill', 3

T2
---
2, 'Desc 2'
2, 'Desc 2'

use Student_course
select * from T1 t1, T2 t2
where t1.jobno = t2.jobno

I get the following results:

name jobno jobno jobdesc
-------------------- ----------- ----------- --------------------
Sam 2 2 Desc 2
Sam 2 2 Desc 2

(2 row(s) affected)

Why does the question suggest that the rows have to contain different descriptions? Unless there is some restriction from
entering duplicate rows for table T2 (which there is not), I would expect to get one row for each match for the equi-join
performed in question 2.a.

Anonymous   
Printed Page 110
Very top

The output shown at the very top of the page is incorrect. The minimum wage is
10.0000 and the maximum wage is 20.0000.

Anonymous   
Printed Page 110
Top of page

Given the table on pg 108, a selection of the minimum wage and the maximum wage should result in the columns 10 and 20
respectively. The output shows a value of 20 under minimum and no value under the maximum column.

Anonymous   
Printed Page 112
All Examples in section 5.2

Table Employee has the Salary Column instead of Wage.

Anonymous   
Printed Page 127
paragraph that begins with "To display the names in a more useful manner"

SELECT statement is wrong as is clearly shown in the output of it that is listed underneath: "Eva" (in 4th row returned:
"Eva, E.") is not the last name of Ed Evans.

To do it right, the LEN function explained on p. 128/129 is needed:

SELECT "Employee Names" = SUBSTRING(names, (CHARINDEX(' ',names)+1 ),
LEN(names) - CHARINDEX(' ',names) ) + ', ' + SUBSTRING(names,1,1) + '.'
FROM Employee

Anonymous   
Printed Page 139
second example of DATEADD function

The second example for the function of DATEADD on page 139 states that you can use DATEADD to subtract 2 days from the birthdate in Datetable. It would be more appropriate then for the statement to be written so that the column title says 'Subtract 2 days from birthday'. This corrected wording needs to be in the SQL statement and the query result example on the page.

Anonymous  Dec 04, 2008 
Printed Page 142
Last code example (bottom of page)

As can be seen on the result of this query shown on next page, the school date for 'Piyali Saha' is not exactly 5 years
added to the current date: 2011-04-01 compared to 2006-01-17.

In my opinion, a more exact solution is:
INSERT INTO DateTable
VALUES (GETDATE(), DATEADD(yy, 5, GETDATE()), 'Piyali Saha')

Resulting row is now:
2007-08-06 21:04:00 2012-08-06 21:04:00 Piyali Saha

Anonymous   
Printed Page 144
String Functions Table

LTRIM function missing from the table

Anonymous  Nov 04, 2008 
Printed Page 148
Question 10

From the preceding chapters, there doesn't appear to be instruction concerning how to achieve the numbering of rows to
achieve PERSON # 1, 2, 3, 4, etc.

Anonymous   
Printed Page 148
Question 12 & 13

There doesn't appear to be instruction by this point in the book about how to achieve printing the number of courses by
each instructor or classes by each student. This can be done with a GROUP BY clause, but this hasn't been introduced yet.

Anonymous   
Printed Page 162
Middle of page

In the section on using column aliases when creating Views, it states on pg. 162 that the name of the view has to precede
the column alias as in:

SELECT namemaj2.[name], namemaj2.[maj]
FROM namemaj2
WHERE namemaj2.[name] LIKE 'J%'

Because it seems completely nonintuitive to require knowledge about which column names are aliases, I also tried the
following which works and would seem to be the more normal usage:

select name, maj
from namemaj2
where name like 'J%'

Anonymous   
Printed Page 198
Botton of page

The select statement presented in the book filters on course_name rather than course_num. Technically, this misses any
accounting classes not starting with 'ACC'. For example, the class "Managerial Finance" is considered an accounting
class. Filtering on course_num LIKE 'ACC%' gives you 29 rows.

Anonymous   
Printed Page 261
Bottom of Page

In the 2nd exercise of of the chapter, we are given a query to improve.
The second to last line of that query reads:

AND Section.course_num LIKE 'COSC___ _'

This isn't correct, and will not match anything. It should read:

AND Section.course_num LIKE 'COSC%'

Anonymous   
Printed Page 275
Bullet 1, Figure 11-13 and paragraph below

The paragraph says we can see that the empno and title fields will not allow nulls, but the "Allow Nulls" box is checked
for "title." This is the same result I got when I ran the code. The first bullet claims "UNIQUE does not necessitate NOT
NULL." It seems the paragraph below Figure 11-13 should be revised.

Anonymous