Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

Creating your MySQL Database: Practical Design Tips and Techniques
Creating your MySQL Database: Practical Design Tips and Techniques
Creating your MySQL Database: Practical Design Tips and Techniques
Ebook218 pages1 hour

Creating your MySQL Database: Practical Design Tips and Techniques

Rating: 3 out of 5 stars

3/5

()

Read preview

About this ebook

This book takes a practical approach, implementing all theoretical concepts with examples. It is a fast-paced tutorial that focuses on critical decisions that you need to make every time you build MySQL databases. It is rich with tips and advice from an experienced practitioner. Anyone working with applications that use a MySQL database backend will benefit greatly from the advice and techniques in this book. Although a working knowledge of both SQL and MySQL is assumed, the book is suitable for both beginners and intermediate users alike. Whether you read it through and absorb the advice or work through it on a live project, the efficiency and maintainability of your databases will certainly improve as a result.
LanguageEnglish
Release dateNov 25, 2006
ISBN9781847190208
Creating your MySQL Database: Practical Design Tips and Techniques
Author

Marc Delisle

Marc Delisle was awarded "MySQL Community Member of the year 2009" because of his involvement with phpMyAdmin. He started to contribute to the project in December 1998, when he made the multi-language version. He is still involved with phpMyAdmin as a developer and project administrator. Marc is a system administrator at Cegep de Sherbrooke, Québec, Canada. He has been teaching networking, security, and web application development. In one of his classes, he was pleased to meet a phpMyAdmin user from Argentina. Marc lives in Sherbrooke with his wife and they enjoy spending time with their four children.

Read more from Marc Delisle

Related to Creating your MySQL Database

Related ebooks

Information Technology For You

View More

Related articles

Reviews for Creating your MySQL Database

Rating: 3 out of 5 stars
3/5

1 rating0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Creating your MySQL Database - Marc Delisle

    Table of Contents

    Creating your MySQL Database: Practical Design Tips and Techniques

    Credits

    About the Author

    About the Reviewer

    0. Preface

    What This Book Covers

    What You Need for This Book

    Conventions

    Reader Feedback

    Customer Support

    Downloading the Example Code for the Book

    Errata

    Questions

    1. Introducing MySQL Design

    MySQL's Popularity and Impact

    The Need for MySQL Design

    What do I do Next?

    Data Design Steps

    Data as a Resource

    But this is my Data!

    Data Modeling

    Overview of the Relational Model

    Rule #1

    Rule #2

    Simplified Design Technique

    Case Study

    Our Car Dealer

    The System's Goals

    The Tale of the Too Wide Table

    Summary

    2. Data Collecting

    System Boundaries Identification

    Modular Development

    Model Flexibility

    Document Gathering

    General Reading

    Forms

    Existing Computerized Systems

    Interviews

    Finding the Right Users

    Perceptions

    Asking the Right Questions

    Existing Information Systems

    Chronological Events

    Sources and Destinations

    Urgency

    Avoid Focusing on Reports and Screens

    Data Collected for our Case Study

    From the General Manager

    From the Salesperson

    From the Store Assistant

    Other Notes

    Summary

    3. Data Naming

    Data Cleaning

    Subdividing Data Elements

    Data Elements Containing Formatting Characters

    Data that are Results

    Data as a Column's or Table's Name

    Planning for Changes

    Pitfalls of the Free Fields Technique

    Naming Recommendations

    Designer's Creativity

    Abbreviations

    Clarity versus Length: an Art

    Suffixing

    The Plural Form

    Naming Consistency

    MySQL's Possibilities versus Portability

    Table Name into a Column Name

    Summary

    4. Data Grouping

    Initial List of Tables

    Rules for Table Layout

    Primary Keys and Table Names

    Data Redundancy and Dependency

    Composite Keys

    Improving the Structure

    Scalability over Time

    Empty Columns

    Avoiding ENUM and SET

    Multilingual Planning

    Validating the Structure

    Summary

    5. Data Structure Tuning

    Data Access Policies

    Responsibility

    Security and Privileges

    Views

    Storage Engines

    Foreign Key Constraints

    Performance

    Indexes

    Helping the Query Optimizer: Analyze Table

    Accessing Replication Slave Servers

    Speed and Data Types

    Table Size Reduction

    In-Column Data Encoding

    Case Study's Final Structure

    Vehicle

    Person

    Sale

    Other tables

    Summary

    6. Supplemental Case Study

    Results from the Document Gathering Phase

    Preliminary List of Data Elements

    Tables and Sample Values

    Code Tables

    Themed Tables

    Composite-Key Tables

    Airline System Data Schema

    Sample Queries

    Inserting Sample Values

    Boarding Pass

    Passenger List

    All Persons on a Flight

    Summary

    Index

    Creating your MySQL Database: Practical Design Tips and Techniques

    Marc Delisle


    Creating your MySQL Database: Practical Design Tips and Techniques

    Copyright © 2006 Packt Publishing

    All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

    Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, Packt Publishing, nor its dealers or distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

    Packt Publishing has endeavored to provide trademark information about all the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

    First published: November 2006

    Production Reference: 1141106

    Published by Packt Publishing Ltd.

    32 Lincoln Road

    Olton

    Birmingham, B27 6PA, UK.

    ISBN 10: 1-904811-30-2

    ISBN 13: 978-1-904811-30-5

    www.packtpub.com

    Cover Image by www.visionwt.com

    Credits

    Author

    Marc Delisle

    Reviewer

    Rudy Limeback

    Development Editor

    Louay Fatoohi

    Assistant Development Editor

    Nikhil Bangera

    Technical Editor

    Mithil Kulkarni

    Editorial Manager

    Dipali Chittar

    Project Manager

    Patricia Weir

    Indexer

    Bhushan Pangaonkar

    Proofreader

    Martin Brooks

    Layouts and Illustrations

    Shantanu Zagade

    Cover Designer

    Shantanu Zagade

    About the Author

    Marc Delisle is a member of the MySQL Developers Guild, which regroups community developers—because of his involvement with phpMyAdmin. He started to contribute to this popular MySQL web interface in December 1998, when he made the first multi-language version. He has been actively involved with the phpMyAdmin project since May 2001 as a developer and project administrator.

    He has worked since 1980 at Collège de Sherbrooke, Québec, Canada, as an application programmer and network manager. He has also been teaching networking, security, Linux servers, and PHP/MySQL application development.

    I would like to thank the whole Packt team for their support, especially Louay Fatoohi and Nikhil Bangera; their advice helped shaping this book. My thanks also go to Rudy Limeback for his insight.

    The developers of the MySQL software have earned my respect; may they find here my warm gratitude for their excellent product.

    I hope that this book will assist readers into building effective data structures.

    To Carole, André, Corinne, Annie, and Guillaume, with all my love.

    About the Reviewer

    Rudy Limeback is an SQL Consultant with close to 20 years of experience using SQL in one database system or another. He is located in Toronto, Canada but, thanks to the miracle that is the Internet, consults for clients all over the wide world.More information on SQL and Web development can be found on Rudy's website, http://www.r937.com/.

    Chapter 0. Preface

    MySQL, launched in 1995, has become the most popular open source database system. The popularity of MySQL and phpMyAdmin has allowed many non-IT specialists to build dynamic websites with a MySQL backend. This book is a short but complete guide showing beginners how to design good data structures for MySQL. It teaches how to plan the data structure and how to implement it physically using MySQL's model.

    What This Book Covers

    Chapter 1 introduces the concept of MySQL, and discusses MySQL's growing popularity and its impact as a powerful tool. This chapter gives us a brief overview of the relational models and Codd's rules, which are required for designing purposes. A brief introduction to our case study—car dealer is provided at the end.

    Chapter 2 shows how to deal with the raw data information that comes from the users or other sources, and the techniques that can help us build a comprehensive data collection. Also, this chapter covers the exact limits of the analyzed system, how one should gather documents, and interview activities for our case study.

    Chapter 3 emphasises on transforming the data elements gathered in the collection process into a cohesive set of column names. The concept of data naming is also discussed in this chapter.

    Chapter 4 provides the technique of grouping column names into tables. Rules for table

    Enjoying the preview?
    Page 1 of 1