Items related to MySQL in a Nutshell

Dyer, Russell MySQL in a Nutshell ISBN 13: 9780596007898

MySQL in a Nutshell - Softcover

 
9780596007898: MySQL in a Nutshell
View all copies of this ISBN edition:
 
 

MySQL is the world's most popular open source database. MySQL is designed for speed, power, and flexibility in mission-critical, heavy-use environments and modest applications as well. It's also surprisingly rich in features. If you're a database administrator or programmer you probably love the myriad of things MySQL can do, but sometimes wish there wasn't such a myriad of things to remember. With MySQL in a Nutshell by your keyboard, you can drill down into the full depth of MySQL's capabilities quickly and easily.MySQL in a Nutshell is the indispensable desktop reference to all MySQL functions. Programming language APIs for PHP, Perl, and C are covered, as well as all the popular MySQL utilities.This invaluable resource clearly documents the details that experienced users need to take full advantage of this powerful database management system. Better yet, this wealth of information is packed into the concise, comprehensive, and extraordinarily easy-to-use format for which the in a Nutshell guides are renowned.In addition to providing a thorough reference to MySQL statements and functions, the administrative utilities, and the most popular APIs, MySQL in a Nutshell includes several tutorial chapters to help newcomers get started. Moreover, each chapter covering an API begins with a brief tutorial so that, regardless of your level of experience in any given area, you will be able to understand and master unfamiliar territory.MySQL in a Nutshell distills all the vital MySQL details you need on a daily basis into one convenient, well-organized book. It will save you hundreds of hours of tedious research or trial and error and put the facts you need to truly tap MySQL's capabilities at your fingertips.

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

About the Author:

Russell Dyer has worked full-time for several years as a free-lance writer of computer articles, primarily on MySQL. He has been working with MySQL AB as the editor of their new Knowledge Base since December 2004. He is the author of "MySQL in a Nutshell" (O'Reilly), and has published over ninety 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. 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.

  • PublisherO′Reilly
  • Publication date2005
  • ISBN 10 0596007892
  • ISBN 13 9780596007898
  • BindingPaperback
  • Number of pages348
  • Rating

Top Search Results from the AbeBooks Marketplace

Stock Image

Dyer, Russell J. T.
Published by O'Reilly Media (2005)
ISBN 10: 0596007892 ISBN 13: 9780596007898
New Soft cover First Edition Quantity: 1
Seller:
BooksByLisa
(Highland Park, IL, U.S.A.)

Book Description Soft cover. Condition: New. 1st Edition. Book. Seller Inventory # ABE-1672429989390

More information about this seller | Contact seller

Buy New
£ 13.18
Convert currency

Add to Basket

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

Dyer, Russell J. T.
Published by O'Reilly Media (2005)
ISBN 10: 0596007892 ISBN 13: 9780596007898
New Paperback Quantity: 1
Seller:
GoldenWavesOfBooks
(Fayetteville, TX, U.S.A.)

Book Description Paperback. Condition: new. New. Fast Shipping and good customer service. Seller Inventory # Holz_New_0596007892

More information about this seller | Contact seller

Buy New
£ 18.09
Convert currency

Add to Basket

Shipping: £ 3.20
Within U.S.A.
Destination, rates & speeds
Stock Image

Dyer, Russell J. T.
Published by O'Reilly Media (2005)
ISBN 10: 0596007892 ISBN 13: 9780596007898
New Softcover Quantity: 1
Seller:
Books Unplugged
(Amherst, NY, U.S.A.)

Book Description Condition: New. Buy with confidence! Book is in new, never-used condition. Seller Inventory # bk0596007892xvz189zvxnew

More information about this seller | Contact seller

Buy New
£ 21.36
Convert currency

Add to Basket

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

Dyer, Russell J. T.
Published by O'Reilly Media (2005)
ISBN 10: 0596007892 ISBN 13: 9780596007898
New Paperback Quantity: 1
Seller:
GoldBooks
(Denver, CO, U.S.A.)

Book Description Paperback. Condition: new. New Copy. Customer Service Guaranteed. Seller Inventory # think0596007892

More information about this seller | Contact seller

Buy New
£ 23.48
Convert currency

Add to Basket

Shipping: £ 3.40
Within U.S.A.
Destination, rates & speeds
Stock Image

Dyer, Russell J. T.
Published by O'Reilly Media (2005)
ISBN 10: 0596007892 ISBN 13: 9780596007898
New Softcover Quantity: 1
Seller:
BennettBooksLtd
(North Las Vegas, NV, U.S.A.)

Book Description Condition: New. New. In shrink wrap. Looks like an interesting title! 1. Seller Inventory # Q-0596007892

More information about this seller | Contact seller

Buy New
£ 47.83
Convert currency

Add to Basket

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