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
phpMyAdmin Starter Rating: 0 out of 5 stars0 ratingsMastering phpMyAdmin 3.1 for Effective MySQL Management Rating: 3 out of 5 stars3/5Mastering phpMyAdmin 3.4 for Effective MySQL Management Rating: 0 out of 5 stars0 ratingsMastering phpMyAdmin 3.3.x for Effective MySQL Management Rating: 0 out of 5 stars0 ratings
Related to Creating your MySQL Database
Related ebooks
Simply SQL: The Fun and Easy Way to Learn Best-Practice SQL Rating: 4 out of 5 stars4/5MySQL for Python Rating: 5 out of 5 stars5/5Learn SQL in 24 Hours Rating: 5 out of 5 stars5/5Mastering HTML5 Forms Rating: 1 out of 5 stars1/5Learn SQL with MySQL: Retrieve and Manipulate Data Using SQL Commands with Ease Rating: 0 out of 5 stars0 ratingsSQL in 30 Pages Rating: 4 out of 5 stars4/5SQL All-in-One For Dummies Rating: 4 out of 5 stars4/5High Availability MySQL Cookbook Rating: 0 out of 5 stars0 ratingsSQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5MySQL Admin Cookbook LITE: Replication and Indexing Rating: 4 out of 5 stars4/5SQL: For Beginners: Your Guide To Easily Learn SQL Programming in 7 Days Rating: 5 out of 5 stars5/5Practical SQL Rating: 4 out of 5 stars4/5The PHP Workshop: Learn to build interactive applications and kickstart your career as a web developer Rating: 0 out of 5 stars0 ratingsJavaScript: Tips and Tricks to Programming Code with Javascript Rating: 0 out of 5 stars0 ratingsThe SQL Workshop: Learn to create, manipulate and secure data and manage relational databases with SQL Rating: 0 out of 5 stars0 ratingsSQL For Dummies Rating: 0 out of 5 stars0 ratingsPHP and MySQL For Dummies Rating: 4 out of 5 stars4/5Mastering MariaDB Rating: 0 out of 5 stars0 ratingsMariaDb Essentials: Quickly get up to speed with MariaDB—the leading, drop-in replacement for MySQL, through this practical tutorial Rating: 0 out of 5 stars0 ratingsPHP, MySQL, & JavaScript All-in-One For Dummies Rating: 5 out of 5 stars5/5Accounting Database Design Rating: 5 out of 5 stars5/5HTML5, JavaScript, and jQuery 24-Hour Trainer Rating: 2 out of 5 stars2/5JavaScript and AJAX For Dummies Rating: 4 out of 5 stars4/5SQL Interview Questions: A complete question bank to crack your ANN SQL interview with real-time examples Rating: 2 out of 5 stars2/5Learn PHP in 24 Hours Rating: 0 out of 5 stars0 ratingsPHP mySQL Web Programming Interview Questions, Answers, and Explanations: PHP mySQL FAQ Rating: 4 out of 5 stars4/5
Information Technology For You
COMPUTER SCIENCE FOR ROOKIES 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/5Character Expression: Using ChatGPT to Write Believable Emotions in Fiction Rating: 3 out of 5 stars3/5CompTia Security 701: Fundamentals of Security Rating: 0 out of 5 stars0 ratingsCODING INTERVIEW: Advanced Methods to Learn and Excel in Coding Interview Rating: 0 out of 5 stars0 ratingsHow to Write Effective Emails at Work Rating: 4 out of 5 stars4/5Windows 11 For Beginners: The Ultimate Step-By-Step Guide To Learning How To Use Windows Like A Pro Rating: 0 out of 5 stars0 ratingsData Analytics for Beginners: Introduction to Data Analytics Rating: 4 out of 5 stars4/5How Computers Really Work: A Hands-On Guide to the Inner Workings of the Machine Rating: 0 out of 5 stars0 ratingsA Practical Guide Wireshark Forensics Rating: 5 out of 5 stars5/5CompTIA A+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Core 1 Exam 220-1101 Rating: 0 out of 5 stars0 ratingsAI Unplugged: Your Everyday Guide to Understanding Artificial Intelligence Rating: 0 out of 5 stars0 ratingsHealth Informatics: Practical Guide Rating: 0 out of 5 stars0 ratingsA Mind at Play: How Claude Shannon Invented the Information Age Rating: 4 out of 5 stars4/5Metasploit Penetration Testing Cookbook Rating: 0 out of 5 stars0 ratingsPractical Ethical Hacking from Scratch Rating: 5 out of 5 stars5/5Build a WordPress Website From Scratch 2025: Step-by-step Rating: 0 out of 5 stars0 ratingsUnlocking the Power of Agentic AI: Transforming Work and Life Rating: 5 out of 5 stars5/5Personal Knowledge Graphs: Connected thinking to boost productivity, creativity and discovery Rating: 5 out of 5 stars5/5How to Find a Wolf in Siberia (or, How to Troubleshoot Almost Anything) Rating: 0 out of 5 stars0 ratingsDevOps Handbook: What is DevOps, Why You Need it and How to Transform Your Business with DevOps Practices Rating: 4 out of 5 stars4/5Cybersecurity Playbook for Executives Rating: 0 out of 5 stars0 ratingsCompTIA Network+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Exam N10-008 Rating: 0 out of 5 stars0 ratingsA pocket companion to PMI's PMBOK Guide Fifth edition Rating: 0 out of 5 stars0 ratingsMicrosoft Access for Beginners and Intermediates Rating: 0 out of 5 stars0 ratingsLinux Command Line and Shell Scripting Bible Rating: 3 out of 5 stars3/5Cybersecurity for Beginners : Learn the Fundamentals of Cybersecurity in an Easy, Step-by-Step Guide: 1 Rating: 0 out of 5 stars0 ratings
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