MariaDB Crash Course

 MariaDB Crash Course

Ben Forta

Upper Saddle River, NJ ? Boston ? Indianapolis ? San Francisco New York ? Toronto ? Montreal ? London ? Munich ? Paris ? Madrid

Cape Town ? Sydney ? Tokyo ? Singapore ? Mexico City

Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals.

The author and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein.

The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests. For more information, please contact:

U.S. Corporate and Government Sales (800) 382-3419 corpsales@

For sales outside the United States, please contact:

International Sales international@

Visit us on the Web: aw

Library of Congress Cataloging-in-Publication Data

Forta, Ben. MariaDB crash course / Ben Forta. p. cm. Includes index. ISBN 978-0-321-79994-4 (pbk.) 1. MariaDB. 2. Database management. 3. Client/server comput-

ing. I. Title.

QA76.9.D3F663 2012 004'.36--dc23

2011023506

Copyright ? 2012 Pearson Education, Inc.

All rights reserved. Printed in the United States of America. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. To obtain permission to use material from this work, please submit a written request to Pearson Education, Inc., Permissions Department, One Lake Street, Upper Saddle River, New Jersey 07458, or you may fax your request to (201) 236-3290.

ISBN-13: 978-0-321-79994-4 ISBN-10: 0-321-79994-1

Text printed in the United States on recycled paper at R.R. Donnelley in Crawfordsville, Indiana.

First printing September 2011

Editor-in-Chief Mark Taub

Acquisitions Editor Mark Taber

Managing Editor Kristy Hart

Project Editors Elaine Wiley

Jovana San NicolasShirley

Copy Editor Geneil Breeze

Indexer Erika Millen

Proofreader Leslie Joseph

Publishing Coordinator Vanessa Evans

Book Designer Gary Adair

Compositor Gloria Schurick

This page intentionally left blank

Table of Contents

Introduction 1 What Is MariaDB Crash Course? 1 Who Is This Book For? 2 Companion Web Site 3 Conventions Used in This Book 3

1: Understanding SQL 5 Database Basics 5 What Is a Database? 6 Tables 6 Columns and Datatypes 7 Rows 8 NULL 8 Primary Keys 9 What Is SQL? 10 Try It Yourself 11 Summary 11

2: Introducing MariaDB 13 What Is MariaDB? 13 Client-Server Software 14 MySQL Compatibility 15 MariaDB Tools 16 mysql Command Line 16 MySQL Workbench 17 Summary 19

3: Working with MariaDB 21 Making the Connection 21 Selecting a Database 22 Learning About Databases and Tables 23 Summary 26

4: Retrieving Data 27 The SELECT Statement 27 Retrieving Individual Columns 27 Retrieving Multiple Columns 29 Retrieving All Columns 30

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download