Synopses & Reviews
If youre a programmer new to databases—or just new to MySQL and its community-driven variant, MariaDB—youve found the perfect introduction. This hands-on guide provides an easy, step-by-step approach to installing, using, and maintaining these popular relational database engines.
Author Russell Dyer, Curriculum Manager at MariaDB and former editor of the MySQL Knowledge Base, takes you through database design and the basics of data management and manipulation, using real-world examples and many practical tips. Exercises and review questions help you practice what youve just learned.
- Create and alter MySQL tables and specify fields and columns within them
- Learn how to insert, select, update, delete, join, and subquery data, using practical examples
- Use built-in string functions to find, extract, format, and convert text from columns
- Learn functions for mathematical or statistical calculations, and for formatting date and time values
- Perform administrative duties such as managing user accounts, backing up databases, and importing large amounts of data
- Use APIs to connect and query MySQL and MariaDB with PHP and other languages
Synopsis
With an easy, step-by-step approach, this practical guide shows programmers new to databases how to install, effectively use, and maintain MySQL and MariaDB. Youll learn these database systems through real-world examples and many practical tips.
Popular and easy-to-use database engines such as MySQL and MariaDB—a community-driven variant of MySQL—help organizations large and small handle data by providing robust and efficient access in ways not offered by spreadsheets and other types of data stores. Experienced web developers and programmers interested in adding MySQL to their skill sets will also find this book useful.
Topics include:
- An introduction to database systems and the SQL database language
- Installation and basic administration of MySQL and MariaDB
- Functions, subqueries, and other query enhancements
- Methods for accessing MySQL and MariaDB from popular programming languages
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/knowledgebase.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
Table of Contents
Foreword; Origins of MySQL; State of MySQL and MariaDB; Beyond the Server; MariaDB: The Differences and Expectations; The Future of MySQL and MariaDB; Your Future in Learning MySQL and MariaDB; Advice on Learning MySQL and MariaDB; Preface; Reading Strategy; Text-Based Interface and Operating Systems; Conventions Used in This Book; Using Code Examples; Safari® Books Online; How to Contact Us; Acknowledgments; The Software; Chapter 1: Introduction; 1.1 The Value of MySQL and MariaDB; 1.2 Mailing Lists and Forums; 1.3 Other Books and Other Publications; Chapter 2: Installing MySQL and MariaDB; 2.1 The Installation Packages; 2.2 Licensing; 2.3 Finding the Software; 2.4 Choosing a Distribution; 2.5 The _AMP Alternatives; 2.6 Post-Installation; Chapter 3: The Basics and the mysql Client; 3.1 The mysql Client; 3.2 Connecting to the Server; 3.3 Starting to Explore Databases; 3.4 Summary; 3.5 Exercises; Database Structures; Chapter 4: Creating Databases and Tables; 4.1 Creating a Database; 4.2 Creating Tables; 4.3 Inserting Data; 4.4 More Perspectives on Tables; 4.5 Summary; 4.6 Exercises; Chapter 5: Altering Tables; 5.1 Prudence When Altering Tables; 5.2 Essential Changes; 5.3 Optional Changes; 5.4 Indexes; 5.5 Summary; 5.6 Exercises; Basics of Handling Data; Chapter 6: Inserting Data; 6.1 The Syntax; 6.2 Practical Examples; 6.3 Other Possibilities; 6.4 Summary; 6.5 Exercises; Chapter 7: Selecting Data; 7.1 Basic Selection; 7.2 Selecting by a Criteria; 7.3 Ordering Results; 7.4 Limiting Results; 7.5 Combining Tables; 7.6 Expressions and the Like; 7.7 Counting and Grouping Results; 7.8 Summary; 7.9 Exercises; Chapter 8: Updating and Deleting Data; 8.1 Updating Data; 8.2 Deleting Data; 8.3 Summary; 8.4 Exercises; Chapter 9: Joining and Subquerying Data; 9.1 Unifying Results; 9.2 Joining Tables; 9.3 Subqueries; 9.4 Summary; 9.5 Exercises; Built-In Functions; Chapter 10: String Functions; 10.1 Formatting Strings; 10.2 Extracting Text; 10.3 Searching Strings and Using Lengths; 10.4 Converting String Types; 10.5 Compressing Strings; 10.6 Summary; 10.7 Exercises; Chapter 11: Date and Time Functions; 11.1 Date and Time Data Types; 11.2 Current Date and Time; 11.3 Extracting Date and Time Components; 11.4 Formatting Dates and Time; 11.5 Adjusting to Standards and Time Zones; 11.6 Adding and Subtracting Dates and Time; 11.7 Comparing Dates and Times; 11.8 Summary; 11.9 Exercises; Chapter 12: Aggregate and Numeric Functions; 12.1 Aggregate Functions; 12.2 Numeric Functions; 12.3 Summary; 12.4 Exercises; Administration and Beyond; Chapter 13: User Accounts and Privileges; 13.1 User Account Basics; 13.2 Restricting the Access of User Accounts; 13.3 Administrative User Accounts; 13.4 Revoking Privileges; 13.5 Deleting a User Account; 13.6 Changing Passwords and Names; 13.7 User Roles; 13.8 Summary; 13.9 Exercises; Chapter 14: Backing Up and Restoring Databases; 14.1 Making Backups; 14.2 Restoring Backups; 14.3 Developing a Backup Policy; 14.4 Summary; 14.5 Exercises; Chapter 15: Bulk Importing Data; 15.1 Preparing to Import; 15.2 Loading Data Basics; 15.3 Better Loading; 15.4 More Field and Line Definitions; 15.5 Importing from Outside MySQL; 15.6 Bulk Exporting Data; 15.7 Summary; 15.8 Exercises; Chapter 16: Application Programming Interfaces; 16.1 Creating API User Accounts; 16.2 C API; 16.3 Perl DBI; 16.4 PHP API; 16.5 Python; 16.6 Ruby API; 16.7 SQL Injection; 16.8 Summary; 16.9 Exercises; Colophon;