SQL Hacks Review

SQL Hacks
Average Reviews:

(More customer reviews)
Are you looking to buy SQL Hacks? Here is the right place to find the great deals. we can offer discounts of up to 90% on SQL Hacks. Check out the link below:

>> Click Here to See Compare Prices and Get the Best Offers

SQL Hacks ReviewTwo problems:
1. Huge quantity of typos and writing and technical errors.
2. It's definitely not "hacking" anything. At best (if it were corrected and proofread) it would be a typical cookbook: a number of loosely connected fragments of code for all kinds of potential scenarios. That's not bad, btw! But hacking it isn't. The word 'hacking' brings to mind an image of a Mad Genius as it were, but this book has absolutely nothing at this level. It's pretty much hum-drum SQL programming -- and I can see how it could be quite useful btw -- provided it didn't have so many egregious errors and typos. Snafus start right from the beginnning, and are at times mind boggling.
The book does have a lot of stuff, most of which is useful -- or rather it would be if you weren't afraid it's got errors in it. You can try of course, you can proofread this book yourself: and, paradoxically, this will be good learning. But personally, when it comes to technical books, I prefer to be able to trust that they're competent and well done, rather than play an amateur editor and try to fix it as I read it.
My recommendation: there's tons of similar stuff, so begin by looking for something else; if still interested, get the book into your hands and read a bit. See if you like it, see if you see errors, see if they bother you. In other words, do not buy this book sight inseen -- chances are high you will be disappointed. I regret that I didn't send this book back; YMMV of course.
Good luck.
----------
Examples:
1. Hack 11, p. 37. The goal is, I quote, "to show the date on which each customer purchased the most _totalitems_" [a tableful of data shown with columns "customer", "whn" [when, that is], and "totalitems"]. Here's the solution:
SELECT customer, whn, totalitems
FROM orders o1
WHERE o1.whn = (
SELECT MAX(whn)
FROM order o2
WHERE o1.customer = o2.customer
);
Why are we MAX'in on date? The result shows -- no surprises -- the latest date in the table, even though more items were sold on another date.
2. Hack 12, p 38. Here we adjust employee salaries based on their disciplinary record. None of this is important; what we do is produce a new salary which is the old one multiplied by something.
The solution is as follows: first, let's create a view with a calculated field with the new salary so we can look at it:
CREATE VIEW newSalary AS
SELECT id, CASE WHEN COUNT(emp) = 0 THEN salary + 100
WHEN COUNT(emp) > 1 THEN salary - 100
ELSE salary
END AS v
FROM employee LEFT JOIN disciplinary ON (id = emp)
GROUP BY id, salary;
So far so good, however: then we update the table itself, as follows:
UPDATE employee
SET slary = (SELECT v FROM newSalary
WHERE newSalary.id = employee.id)
WHERE id IN (SELECT id FROM newSalary);
Look at the second statement: what is the significance of the last WHERE check?
The newSalary is a *view* on the employee table, and it is a view that does not exclude any records -- so what exactly are we checking now? If you've got a record to update, it is already in ! The view is on the table, it IS the table, it doesn't matter if you look at a record directly in the table or through a view, it's one and the same set element. You can't find a record in the table that's not in the view!
3. Hack 13, "Choose the Right Join Style for Your Relationships", p.42 (typos): in the third paragraph, the reference to 'budget' table should have been to 'staff'; 'TRO2' should have been 'TR01'.
Also, at the very beginning, "When a relationship between tables is optional, you need an OUTER JOIN. When querying over many changes, if you require an OUTER JOIN you sometimes have to change all the other INNER JOINs into OUTER JOINs."
What does this mean? "When a relationship between tables is optional, you need an OUTER JOIN"? This doesn't mean a damn thing. Maybe it should be something like "an existing match" instead of "relationship"? I think so, but who knows...SQL Hacks Overview
Whether you're running Access, MySQL, SQL Server, Oracle, or PostgreSQL, this book will help you push the limits of traditional SQL to squeeze data effectively from your database.The book offers 100 hacks -- unique tips and tools -- that bring you the knowledge of experts who apply what they know in the real world to help you take full advantage of the expressive power of SQL. You'll find practical techniques to address complex data manipulation problems.Learn how to:

Wrangle data in the most efficient way possible
Aggregate and organize your data for meaningful and accurate reporting
Make the most of subqueries, joins, and unions
Stay on top of the performance of your queries and the server that runs them
Avoid common SQL security pitfalls, including the dreaded SQL injection attack

Let SQL Hacks serve as your toolbox for digging up and manipulating data.If you love to tinker and optimize, SQL is the perfect technology and SQL Hacks is the must-have book for you.


Want to learn more information about SQL Hacks?

>> Click Here to See All Customer Reviews & Ratings Now

0 comments:

Post a Comment