MySQL in a Nutshell (In a Nutshell (O'Reilly)) and over 2 million other books are available for Amazon Kindle . Learn more


or
Sign in to turn on 1-Click ordering.
Trade in Yours
For a £2.23 Gift Card
Trade in
More Buying Choices
Have one to sell? Sell yours here
Sorry, this item is not available in
Image not available for
Colour:
Image not available

 
Start reading MySQL in a Nutshell (In a Nutshell (O'Reilly)) on your Kindle in under a minute.

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

MySQL in a Nutshell (In a Nutshell (O'Reilly)) [Paperback]

Russell J.T. Dyer
4.2 out of 5 stars  See all reviews (4 customer reviews)
Price: £22.50 & FREE Delivery in the UK. Details
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
Only 10 left in stock (more on the way).
Dispatched from and sold by Amazon. Gift-wrap available.
Want it tomorrow, 27 Oct.? Choose Express delivery at checkout. Details

Formats

Amazon Price New from Used from
Kindle Edition £17.50  
Paperback £22.50  
Trade In this Item for up to £2.23
Trade in MySQL in a Nutshell (In a Nutshell (O'Reilly)) for an Amazon Gift Card of up to £2.23, which you can then spend on millions of items across the site. Trade-in values may vary (terms apply). Learn more

Book Description

25 April 2008 0596514336 978-0596514334 2

When you need to find the right SQL keyword or MySQL client command-line option right away, turn to this convenient reference, known for the same speed and flexibility as the system it covers so thoroughly. MySQL is packed with so many capabilities that the odds of remembering a particular function or statement at the right moment are pretty slim. With MySQL in a Nutshell, you get the details you need, day in and day out, in one concise and extremely well organized book.

The new edition contains all the commands and programming information for version 5.1, including new features and language interfaces. It's ideal for anyone using MySQL, from novices who need to get up to speed to advanced users who want a handy reference. Like all O'Reilly Nutshell references, it's easy to use and highly authoritative, written by the editor of the MySQL Knowledge Base at MySQL AB, the creator and owner of MySQL.

Inside, you'll find:

  • A thorough reference to MySQL statements, functions, and administrative utilities
  • Several tutorial chapters to help newcomers get started
  • Programming language APIs for PHP, Perl, and C
  • Brief tutorials at the beginning of each API chapter to help anyone, regardless of experience level, understand and master unfamiliar territory
  • New chapters on replication, triggers, and stored procedures
  • Plenty of new examples of how MySQL is used in practice
  • Useful tips to help you get through the most difficult subjects
Whether you employ MySQL in a mission-critical, heavy-use environment or for applications that are more modest, this book puts a wealth of easy-to-find information at your fingertips, saving you hundreds of hours of trial and error and tedious online searching. If you're ready to take advantage of everything MySQL has to offer, MySQL in a Nutshell has precisely what it takes.


Special Offers and Product Promotions

  • Between 20-26 October 2014, spend £10 in a single order on item(s) dispatched from and sold by Amazon.co.uk and receive a £2 promotional code to spend in the Amazon Appstore. Here's how (terms and conditions apply)

Frequently Bought Together

MySQL in a Nutshell (In a Nutshell (O'Reilly)) + PHP in a Nutshell (In a Nutshell (O'Reilly))
Price For Both: £42.00

Buy the selected items together


Product details

  • Paperback: 566 pages
  • Publisher: O'Reilly Media; 2 edition (25 April 2008)
  • Language: English
  • ISBN-10: 0596514336
  • ISBN-13: 978-0596514334
  • Product Dimensions: 15.5 x 3 x 22.8 cm
  • Average Customer Review: 4.2 out of 5 stars  See all reviews (4 customer reviews)
  • Amazon Bestsellers Rank: 374,416 in Books (See Top 100 in Books)
  • See Complete Table of Contents

More About the Author

Discover books, learn about writers, and more.

Product Description

About the Author

Russell Dyer is a freelance writer specializing in MySQL database software and is the editor of the MySQL Knowledge Base (http://www.mysql.com/network/knowledgeba​se.html). He is the author of MySQL in a Nutshell (http://www.oreilly.com/catalog/mysqlian/) and has writen articles for several magazines: Dev Zone (a MySQL publication), Linux Journal, ONlamp.com, The Perl Journal, Red Hat Magazine, SysAdmin Magazine, Tech Republic, Unix Review, and XML.com. He has also finished his first novel, "In Search of Kafka". More information on Russell, along with a list of his published articles with links to them, can be found on his web site at http://russell.dyerhouse.com

Excerpt. © Reprinted by permission. All rights reserved.

Chapter 6 Date and Time Functions

The ability to record dates and times in a MySQL database is a very common requirement. This chapter presents the date and time functions for MySQL.

Date and time data comprises only numeric strings, so it can be stored in a regular character column. However, by using temporal datatype columns, you can use several built-in functions offered by MySQL. Currently, five temporal datatypes are available: date, time, datetime, timestamp, and year. The date column type is only for recording the date and uses the format yyyy-mm-dd. The time column type is for recording time in the format hhh:mm:ss. To record a combination of date and time, you can use the datetime column type: yyyy-mm-dd hh:mm:ss. The timestamp column is similar to datetime, but is a little limited in its range of allowable time: it starts at the Unix epoch time (i.e., 1970-01-01) and ends at the end of 2037. Finally, the year datatype is used only for recording the year in a column.

Incidentally, any function that calls for a date or a time datatype will also accept a combined datetime datatype. For more information on date and time datatypes, see Appendix A.

Validation of date strings is limited: MySQL makes sure that months range only from 0 to 12, and days range from 0 to 31. Therefore, a date such as February 30would be accepted. Version 5.0.2 of MySQL will offer more refined validation that would reject such a date.

At the end of this introduction is a listing of date and time functions, grouped by type of function. The bulk of this chapter consists of an alphabetical listing of date and time functions, with explanations of each. Many functions come with examples, along with a resulting display. For help in locating functions, see the index at the back of this book.

For the examples in this chapter, I used the scenario of a professional services firm (e.g., a law firm or an investment advisory firm) that tracks appointments and seminars in MySQL.

Date and Time Functions Grouped by Type

This section lists the functions according to their purpose: to retrieve a time, extract an element of one, or perform calculations on it.

Determining the Date and Time
CURDATE( ), CURRENT_DATE, CURTIME( ), CURRENT_TIME, CURRENT_TIMESTAMP, NOW( ),LOCALTIME( ), LOCALTIMESTAMP( ), SYSDATE( ), UNIX_TIMESTAMP( ), UTC_DATE( ), UTC_TIME( ), UTC_TIMESTAMP( )

Extracting and Formatting the Date and Time
DATE( ), DATE_FORMAT( ), DAY( ), DAYNAME( ), DAYOFMONTH( ), DAYOFWEEK( ), DAYOFYEAR( ), EXTRACT( ), GET_FORMAT( ), HOUR( ), LAST_DAY( ), MAKEDATE( ), MAKETIME( ), MINUTE( ), MONTH( ), MONTHNAME( ), QUARTER( ), SECOND( ), STR_TO_DATE( ), TIME_FORMAT( ), TIMESTAMP( ), WEEK( ), WEEKDAY( ), WEEKOFYEAR( ), YEAR( ), YEARWEEK( )

Calculating and Modifying the Date and Time
ADDDATE( ), ADDTIME( ), CONVERT_TZ( ), DATE_ADD( ), DATE_SUB( ), DATEDIFF( ), FROM_DAYS( ), FROM_UNIXTIME( ), PERIOD_ADD( ), PERIOD_DIFF( ), SEC_TO_TIME( ), SUBDATE( ), SUBTIME( ), TIME_TO_SEC( ), TO_DAYS( ), TIMEDIFF( ), TIMESTAMPADD( ), TIMESTAMPDIFF( )

Date and Time Functions in Alphabetical Order

The rest of the chapter lists each function in alphabetical order.

ADDDATE( )
ADDDATE(date,INTERVAL value type)

This function adds the given interval of time to the date or time provided. This is an alias for DATE_ADD( ); see its definition for details and interval types.

UPDATE seminars
SET seminar_date = ADDDATE(seminar_date, INTERVAL 7 DAY)
WHERE seminar_date = '2004-12-15'';

This example postpones the seminar that was scheduled for December 15, 2004 to December 22—seven days later. As of Version 4.1 of MySQL, for adding days the second argument of the function may simply be the number of days (i.e., just 7 instead of INTERVAL 7 DAY). --This text refers to an alternate Paperback edition.


Inside This Book (Learn More)
Browse Sample Pages
Front Cover | Copyright | Table of Contents | Excerpt | Back Cover
Search inside this book:

What Other Items Do Customers Buy After Viewing This Item?


Customer Reviews

4 star
0
3 star
0
1 star
0
4.2 out of 5 stars
4.2 out of 5 stars
Most Helpful Customer Reviews
1 of 1 people found the following review helpful
5.0 out of 5 stars everything you need for successful mysql 28 Jan 2011
By Lubo D.
Format:Paperback
im currently studing IT on a degree course and as i had the same book borrowed from the school library, i knew it was written on high standard. even though i borrowed the newer version, i decided to buy this one - price decided it for me, but i can't say there is big difference in these two versions (the newer comes with couple new features built into the newer MySQL, but you still get all you need for building solid and powerful code in MySQL). i would definitely suggest buying the book - as a reference book it is published by O'Reilly and let's all be honest - they are the best ones for books of this kind. thanks
Comment | 
Was this review helpful to you?
Format:Paperback|Verified Purchase
I might as well just have printed off the MySQL on-line documentation, this book really adds little. It's not an introduction for a novice and it doesn't provide real in-depth technical information for the advanced user, it's essentially a language reference. Handy to have lying around, but not what I was hoping for.
Comment | 
Was this review helpful to you?
5.0 out of 5 stars A most useful book 12 April 2012
By alana
Format:Paperback|Verified Purchase
This has had extensive use in the last few months, as I have been creating a web site from scratch. It is best used in conjunction with Google, as there are both formal documentation and a lot of examples available there.

There is an error on pages 32 and 33 - the TEXT_FIELDS function mentioned doesn't exist without additional plugins, that are not part of the standard mysql distribution.
Comment | 
Was this review helpful to you?
1 of 5 people found the following review helpful
5.0 out of 5 stars Excellent Condition, Excellent Book 16 Oct 2010
By James T
Format:Paperback
I ordered this book mostly to refer to example SQL code, ranging from basic to complex queries. This book demonstrates and explains each example clearly (with drawn tables). Would definitely recommend it to those who wish to learn SQL. I received this item quickly and was amazed at the condition of the book. The item description warned of minor bookshelf wear but you could almost class the book as brand new. Extremely happy with it and would definitely purchase from the seller again.
Was this review helpful to you?
Most Helpful Customer Reviews on Amazon.com (beta)
Amazon.com: 4.3 out of 5 stars  11 reviews
22 of 24 people found the following review helpful
4.0 out of 5 stars you need a background in SQL 8 May 2005
By W Boudville - Published on Amazon.com
Format:Paperback
Well the book certainly seems to cover MySQL's features quite comprehensively. But, as it is a reference manual, it does not attempt to teach you MySQL or the theory of relational databases. For a given MySQL command, the book's explanation is succinct and useful. Provided you already have a background in the area. Much of the book's discussion is probably already available in equivalent form in the online help. But hardcopy is nice to have.

Going through the functions, what you might appreciate about MySQL is that many of these are generic SQL functions. If you come from any other SQL implementation, your background will be relevant to much of the book.
23 of 26 people found the following review helpful
5.0 out of 5 stars MySQL and how to use it effectively! 6 Jan 2006
By Rob Wehrli - Published on Amazon.com
Format:Paperback
The book is "A Desktop Quick Reference" just as billed on the cover. It is explicitly MySQL-centric and doesn't stray from that core message. It is extremely up-to-date considering the rapidity of movement in MySQL development progress.

I feel that its author, Russell Dyer is the kind of person who is easy to talk to and immediately be comfortable with based on his style and presentation in this book.

The content of this book is very well organized in keeping with the finest traditions at O'Reilly & Associates. There is an installation guide, tutorial, SQL syntax reference, MySQL built-in functions section(s), command-line utilities reference and programming languages API references for PERL, PHP and C. These API references demonstrate commonplace MySQL usage through clear, easy-to-read examples that make good sense.

It is a very comprehensive text that reads as easily as a favorite novel yet is concise enough to be your first "go-to" on MySQL issues you may face day-in and day-out. It is truly the "most advanced kingfisher" (cover animal) on the topic and, like the Pied kingfisher, it is lightweight and demonstrates keenly honed survival skills.

I use MySQL daily and I find it very useful and enjoyable. I don't want to become an SQL guru or even a DBA, as a programmer, I enjoy having MySQL In A Nutshell close at hand so that I can focus on writing code. Thank you Mr. Dyer (and the folks at O'Reilly) for a job well-done! I heartily recommend it to everyone using MySQL. The convenience of this publication clearly outweighs its cost. Newcomers and RDBMS "old-timers" will appreciate this book equally.
28 of 34 people found the following review helpful
4.0 out of 5 stars Another Solid Nutshell Book 17 May 2005
By Larry - Published on Amazon.com
Format:Paperback
Ah, "Nutshell" books - you gotta love `em. Or maybe you don't. I won't get into the pros and cons of online documentation versus books because this subject has been rehashed ad infinitum. Truth is, there are pros and cons for both, and we each have our own reasons for our own preferences.

That being said, if you like book documentation - and "Nutshell" books in particular - then you will like this book. I happen to think it is a good idea to tear yourself away from the keyboard/screen every once in awhile, and the "Nutshell" books give you a good reason for doing so.

I'm not a SQL expert, so I liked the tutorial-flavored introductions at the beginning of each chapter, followed by the conversational tone of the clear and concise examples. I did not have this book when I first started programming using MySQL, and that's too bad because it could have saved me a lot of wasted time with its explanations of some of the more nefarious "gotchas" of the language.

I have but one criticism and one suggestion:

Criticism: The following APIs are covered at the end of the book: Perl, PHP, and C. I can see leaving out COBOL and Lisp (if there are even APIs for these languages), but Java? Granted, the Java interface to MySQL is well-documented in many places, but if you are discussing the *major* programming language APIs to MySQL then you should do just that.

Suggestion: The beginning of the book provides an introduction to MySQL via command-line instructions. I can see doing this, even though no one interacts with databases through the command line. What I think would be even more useful would be a brief discussion of the two tools that everyone does use: MySQL Administrator and MySQL Query Browser. A couple of chapters (along with some screen shots) of what they are, why we need them, where to get them, and how to use them would really make this book perfect. (If you don't forget that Java API chapter!)
2 of 2 people found the following review helpful
5.0 out of 5 stars Great Reference 30 July 2010
By Darth Mortis - Published on Amazon.com
Format:Paperback|Verified Purchase
I don't think a long, comprehensive review is needed here. This is a quick reference guide to have handy when you're working on a project or whatever. You won't learn MySQL from it but as long as you are already familiar with it, it serves as a great, quick reference, especially when you are utilizing keywords or routines that you don't normally use and therefore don't have in the forefront of your mind. If you need a bit of a field refresher, this works great!
7 of 9 people found the following review helpful
4.0 out of 5 stars It does not cover MySQL 5 or later. 7 Jun 2007
By Amazon Shopper - Published on Amazon.com
Format:Paperback|Verified Purchase
It's a great reference but dated. If I had known that it only covers through version 4, I would not have purchased it.
Were these reviews helpful?   Let us know
Search Customer Reviews
Only search this product's reviews

Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
 

Search Customer Discussions
Search all Amazon discussions
   


Look for similar items by category


Feedback