Creating your MySQL Database: Practical Design Tips and Techniques
By Marc Delisle
3/5
()
About this ebook
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
Mastering phpMyAdmin 3.4 for Effective MySQL Management Rating: 0 out of 5 stars0 ratingsMastering phpMyAdmin 3.1 for Effective MySQL Management Rating: 3 out of 5 stars3/5Mastering phpMyAdmin 3.3.x for Effective MySQL Management Rating: 0 out of 5 stars0 ratings
Related to Creating your MySQL Database
Related ebooks
Learn SQL with MySQL: Retrieve and Manipulate Data Using SQL Commands with Ease Rating: 0 out of 5 stars0 ratingsMySQL Management and Administration with Navicat Rating: 0 out of 5 stars0 ratingsMariaDB Essentials Rating: 0 out of 5 stars0 ratingsEffective MySQL Optimizing SQL Statements Rating: 3 out of 5 stars3/5SQL Interview Questions: A complete question bank to crack your ANN SQL interview with real-time examples Rating: 0 out of 5 stars0 ratingsLearn SQL in 24 Hours Rating: 5 out of 5 stars5/5PostgreSQL for Data Architects Rating: 0 out of 5 stars0 ratingsSQL: For Beginners: Your Guide To Easily Learn SQL Programming in 7 Days Rating: 5 out of 5 stars5/5Accounting Database Design Rating: 5 out of 5 stars5/5MySQL for Python Rating: 5 out of 5 stars5/5Learning PHP 7 Rating: 4 out of 5 stars4/5PHP & MySQL Practice It Learn It Rating: 3 out of 5 stars3/5Mastering HTML5 Forms Rating: 1 out of 5 stars1/5Mastering PostgreSQL 9.6 Rating: 0 out of 5 stars0 ratingsHow to Learn PHP, MySQL and Javascript Quickly!: For Dummies Rating: 5 out of 5 stars5/5PHP jQuery Cookbook Rating: 0 out of 5 stars0 ratingsJavaScript Unlocked Rating: 5 out of 5 stars5/5SQL in 30 Pages Rating: 4 out of 5 stars4/5PHP 7 Programming Cookbook Rating: 0 out of 5 stars0 ratingsHTML, CSS, Bootstrap, Php, Javascript and MySql: All you need to know to create a dynamic site Rating: 4 out of 5 stars4/5Learning jQuery Rating: 4 out of 5 stars4/5Mastering JavaScript Rating: 4 out of 5 stars4/5PHP Reactive Programming Rating: 0 out of 5 stars0 ratingsLearning PHP 7 High Performance Rating: 0 out of 5 stars0 ratingsIntroducing PHP 7/MySQL Rating: 0 out of 5 stars0 ratingsJavaScript: Best Practices to Programming Code with JavaScript Rating: 0 out of 5 stars0 ratingsDjango Admin Cookbook Rating: 0 out of 5 stars0 ratingsInstant SASS CSS How-to Rating: 5 out of 5 stars5/5
Information Technology For You
Data Analytics for Beginners: Introduction to Data Analytics Rating: 4 out of 5 stars4/5Summary of Super-Intelligence From Nick Bostrom Rating: 4 out of 5 stars4/5CompTia Security 701: Fundamentals of Security Rating: 0 out of 5 stars0 ratingsAn Ultimate Guide to Kali Linux for Beginners Rating: 3 out of 5 stars3/5Creating Online Courses with ChatGPT | A Step-by-Step Guide with Prompt Templates Rating: 4 out of 5 stars4/5How to Write Effective Emails at Work Rating: 4 out of 5 stars4/5COMPUTER SCIENCE FOR ROOKIES Rating: 0 out of 5 stars0 ratingsPractical Ethical Hacking from Scratch Rating: 5 out of 5 stars5/5Health Informatics: Practical Guide Rating: 0 out of 5 stars0 ratingsVisual Studio Code for Python Programmers Rating: 0 out of 5 stars0 ratingsInkscape Beginner’s Guide Rating: 5 out of 5 stars5/5Supercommunicator: Explaining the Complicated So Anyone Can Understand Rating: 3 out of 5 stars3/5Raspberry Pi :Raspberry Pi Guide On Python & Projects Programming In Easy Steps Rating: 3 out of 5 stars3/5CompTIA Network+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Exam N10-008 Rating: 0 out of 5 stars0 ratingsCybersecurity for Beginners : Learn the Fundamentals of Cybersecurity in an Easy, Step-by-Step Guide: 1 Rating: 0 out of 5 stars0 ratingsWho Says Elephants Can't Dance?: Leading a Great Enterprise Through Dramatic Change Rating: 4 out of 5 stars4/5A Mind at Play: How Claude Shannon Invented the Information Age Rating: 4 out of 5 stars4/5Oracle JD Edwards EnterpriseOne 9.0: Supply Chain Management Cookbook Rating: 0 out of 5 stars0 ratingsLinux Command Line and Shell Scripting Bible Rating: 3 out of 5 stars3/5CompTIA A+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Core 1 Exam 220-1101 Rating: 0 out of 5 stars0 ratingsSpreadsheets To Cubes (Advanced Data Analytics for Small Medium Business): Data Science Rating: 0 out of 5 stars0 ratingsCODING INTERVIEW: Advanced Methods to Learn and Excel in Coding Interview Rating: 0 out of 5 stars0 ratingsLearning Microsoft Endpoint Manager: Unified Endpoint Management with Intune and the Enterprise Mobility + Security Suite Rating: 0 out of 5 stars0 ratings20 Windows Tools Every SysAdmin Should Know Rating: 5 out of 5 stars5/5Microsoft Access for Beginners and Intermediates Rating: 0 out of 5 stars0 ratingsPersonal Knowledge Graphs: Connected thinking to boost productivity, creativity and discovery Rating: 0 out of 5 stars0 ratingsAWS Certified Cloud Practitioner: Study Guide with Practice Questions and Labs Rating: 5 out of 5 stars5/5
Reviews for Creating your MySQL Database
1 rating0 reviews
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