MySQL in a Nutshell (In a Nutshell (O'Reilly))

3.64 avg rating
( 47 ratings by Goodreads )
 
9780596514334: MySQL in a Nutshell (In a Nutshell (O'Reilly))
View all copies of this ISBN edition:
 
 

Paperback. Pub Date: 2008 Pages: 566 in Publisher: OReilly Media When you need to find the right SQL keyword or MySQL client command-line option right away turn to the the 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 t

"synopsis" may belong to another edition of this title.

About the Author:

Russell Dyer is a freelance writer and currently the CurriculumManager at MariaDB Ab. He worked previously for six years at MySQL Ab. as their Knowledge Base Editor. 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).

"About this title" may belong to another edition of this title.

Top Search Results from the AbeBooks Marketplace

1.

MISC
ISBN 10: 0596514336 ISBN 13: 9780596514334
New Quantity Available: 1
Seller:
bookscollection
(Delhi, DELHI, India)
Rating
[?]

Book Description Condition: Brand New. Book Condition New, U.S. EDITION. We Do not Ship APO FPO AND PO BOX. Printing in English language. Quick delivery by USPS/UPS/DHL/FEDEX/ARAMEX ,Customer satisfaction guaranteed. We may ship the books from Asian regions for inventory purpose. Seller Inventory # 9780596514334 ABE$KHD$

More information about this seller | Contact this seller

Buy New
£ 12.39
Convert currency

Add to Basket

Shipping: £ 3.15
From India to U.S.A.
Destination, rates & speeds

2.

Dyer, Russell J.
Published by O'Reilly Media 4/1/2008 (2008)
ISBN 10: 0596514336 ISBN 13: 9780596514334
New Paperback or Softback Quantity Available: 5
Seller:
BargainBookStores
(Grand Rapids, MI, U.S.A.)
Rating
[?]

Book Description O'Reilly Media 4/1/2008, 2008. Paperback or Softback. Condition: New. MYSQL in a Nutshell. Book. Seller Inventory # BBS-9780596514334

More information about this seller | Contact this seller

Buy New
£ 18.98
Convert currency

Add to Basket

Shipping: FREE
Within U.S.A.
Destination, rates & speeds

3.

Russell Dyer
Published by O'Reilly Media, Inc, USA, United States (2008)
ISBN 10: 0596514336 ISBN 13: 9780596514334
New Paperback Quantity Available: 1
Seller:
The Book Depository
(London, United Kingdom)
Rating
[?]

Book Description O'Reilly Media, Inc, USA, United States, 2008. Paperback. Condition: New. 2nd Revised edition. Language: English. Brand new Book. 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. Seller Inventory # AAH9780596514334

More information about this seller | Contact this seller

Buy New
£ 19.25
Convert currency

Add to Basket

Shipping: FREE
From United Kingdom to U.S.A.
Destination, rates & speeds

4.

Russell Dyer
Published by O'Reilly Media, Inc, USA, United States (2008)
ISBN 10: 0596514336 ISBN 13: 9780596514334
New Paperback Quantity Available: 1
Seller:
Book Depository International
(London, United Kingdom)
Rating
[?]

Book Description O'Reilly Media, Inc, USA, United States, 2008. Paperback. Condition: New. 2nd Revised edition. Language: English. Brand new Book. 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. Seller Inventory # AAH9780596514334

More information about this seller | Contact this seller

Buy New
£ 19.85
Convert currency

Add to Basket

Shipping: FREE
From United Kingdom to U.S.A.
Destination, rates & speeds

5.

Dyer, Russell J. T.
Published by O'Reilly Media
ISBN 10: 0596514336 ISBN 13: 9780596514334
New PAPERBACK Quantity Available: > 20
Seller:
Mediaoutlet12345
(Springfield, VA, U.S.A.)
Rating
[?]

Book Description O'Reilly Media. PAPERBACK. Condition: New. 0596514336 *BRAND NEW* Ships Same Day or Next!. Seller Inventory # SWATI2132918789

More information about this seller | Contact this seller

Buy New
£ 16.75
Convert currency

Add to Basket

Shipping: £ 3.10
Within U.S.A.
Destination, rates & speeds

6.

Dyer, Russell J. T.
Published by O'Reilly Media (2019)
ISBN 10: 0596514336 ISBN 13: 9780596514334
New Paperback Quantity Available: > 20
Print on Demand
Seller:
Murray Media
(NORTH MIAMI BEACH, FL, U.S.A.)
Rating
[?]

Book Description O'Reilly Media, 2019. Paperback. Condition: New. Never used! This item is printed on demand. Seller Inventory # 0596514336

More information about this seller | Contact this seller

Buy New
£ 22.06
Convert currency

Add to Basket

Shipping: FREE
Within U.S.A.
Destination, rates & speeds

7.

Russell Dyer
Published by O'Reilly Media (2008)
ISBN 10: 0596514336 ISBN 13: 9780596514334
New Paperback Quantity Available: 1
Seller:
Ergodebooks
(RICHMOND, TX, U.S.A.)
Rating
[?]

Book Description O'Reilly Media, 2008. Paperback. Condition: New. Second Edition. Seller Inventory # DADAX0596514336

More information about this seller | Contact this seller

Buy New
£ 21.50
Convert currency

Add to Basket

Shipping: £ 3.10
Within U.S.A.
Destination, rates & speeds

8.

Russell Dyer
Published by O'Reilly Media, Inc, USA
ISBN 10: 0596514336 ISBN 13: 9780596514334
New Paperback Quantity Available: 5
Seller:
THE SAINT BOOKSTORE
(Southport, United Kingdom)
Rating
[?]

Book Description O'Reilly Media, Inc, USA. Paperback. Condition: New. New copy - Usually dispatched within 2 working days. Seller Inventory # B9780596514334

More information about this seller | Contact this seller

Buy New
£ 18.24
Convert currency

Add to Basket

Shipping: £ 6.94
From United Kingdom to U.S.A.
Destination, rates & speeds

9.

Russell J. T. Dyer
Published by O'Reilly Media
ISBN 10: 0596514336 ISBN 13: 9780596514334
New Paperback Quantity Available: > 20
Seller:
BuySomeBooks
(Las Vegas, NV, U.S.A.)
Rating
[?]

Book Description O'Reilly Media. Paperback. Condition: New. 566 pages. Dimensions: 8.8in. x 6.1in. x 1.3in.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. Its ideal for anyone using MySQL, from novices who need to get up to speed to advanced users who want a handy reference. Like all OReilly Nutshell references, its 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, youll find: A thorough reference to MySQL statements, functions, and administrative utilitiesSeveral tutorial chapters to help newcomers get startedProgramming language APIs for PHP, Perl, and CBrief tutorials at the beginning of each API chapter to help anyone, regardless of experience level, understand and master unfamiliar territoryNew chapters on replication, triggers, and stored proceduresPlenty of new examples of how MySQL is used in practiceUseful tips to help you get through the most difficult subjectsWhether 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 youre ready to take advantage of everything MySQL has to offer, MySQL in a Nutshell has precisely what it takes. This item ships from multiple locations. Your book may arrive from Roseburg,OR, La Vergne,TN. Paperback. Seller Inventory # 9780596514334

More information about this seller | Contact this seller

Buy New
£ 25.57
Convert currency

Add to Basket

Shipping: FREE
Within U.S.A.
Destination, rates & speeds

10.

Russell J. T. Dyer
Published by O'Reilly Media (2008)
ISBN 10: 0596514336 ISBN 13: 9780596514334
New Softcover Quantity Available: 1
Seller:
Irish Booksellers
(Portland, ME, U.S.A.)
Rating
[?]

Book Description O'Reilly Media, 2008. Condition: New. book. Seller Inventory # M0596514336

More information about this seller | Contact this seller

Buy New
£ 26.21
Convert currency

Add to Basket

Shipping: £ 2.54
Within U.S.A.
Destination, rates & speeds

There are more copies of this book

View all search results for this book