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.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 Admin Cookbook LITE: Replication and Indexing Rating: 4 out of 5 stars4/5SQL CODING FOR BEGINNERS: Step-by-Step Beginner's Guide to Mastering SQL Programming and Coding (2022 Crash Course for Newbies) 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/5MariaDB Essentials Rating: 0 out of 5 stars0 ratingsLearn T-SQL Querying: A guide to developing efficient and elegant T-SQL code Rating: 0 out of 5 stars0 ratingsLearn SQL in 24 Hours Rating: 5 out of 5 stars5/5Learning PHP Data Objects Rating: 5 out of 5 stars5/5PostgreSQL for Data Architects Rating: 0 out of 5 stars0 ratingsDatabase Design and SQL for DB2 Rating: 5 out of 5 stars5/5MySQL Management and Administration with Navicat Rating: 0 out of 5 stars0 ratingsSQL Interview Questions: A complete question bank to crack your ANN SQL interview with real-time examples Rating: 0 out of 5 stars0 ratingsGetting Started with SQL Server 2014 Administration Rating: 0 out of 5 stars0 ratingsASP.Net Web Developer's Guide Rating: 0 out of 5 stars0 ratingsMySQL for Python Rating: 5 out of 5 stars5/5The PHP Workshop: Learn to build interactive applications and kickstart your career as a web developer Rating: 0 out of 5 stars0 ratingsHigh Availability MySQL Cookbook 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 ratingsPHP and MySQL For Dummies Rating: 4 out of 5 stars4/5JavaScript: Best Practices to Programming Code with JavaScript Rating: 0 out of 5 stars0 ratingsPHP for Beginners: Your Guide to Easily Learn PHP In 7 Days Rating: 4 out of 5 stars4/5Learning PostgreSQL Rating: 1 out of 5 stars1/5How to Learn PHP, MySQL and Javascript Quickly!: For Dummies Rating: 5 out of 5 stars5/5PHP mySQL Web Programming Interview Questions, Answers, and Explanations: PHP mySQL FAQ Rating: 4 out of 5 stars4/5Mastering MariaDB Rating: 0 out of 5 stars0 ratingsPostgreSQL Development Essentials Rating: 5 out of 5 stars5/5Relational Database Design and Implementation Rating: 5 out of 5 stars5/5Learning PHP 7 High Performance Rating: 0 out of 5 stars0 ratingsJavaScript and JSON Essentials Rating: 5 out of 5 stars5/5
Information Technology For You
How to Write Effective Emails at Work Rating: 4 out of 5 stars4/5ChatGPT: The Future of Intelligent Conversation Rating: 4 out of 5 stars4/5How To Use Chatgpt: Using Chatgpt To Make Money Online Has Never Been This Simple Rating: 0 out of 5 stars0 ratingsData Analytics for Beginners: Introduction to Data Analytics Rating: 4 out of 5 stars4/5Creating Online Courses with ChatGPT | A Step-by-Step Guide with Prompt Templates Rating: 4 out of 5 stars4/5Practical Ethical Hacking from Scratch Rating: 5 out of 5 stars5/5Summary of Super-Intelligence From Nick Bostrom Rating: 5 out of 5 stars5/5Linux 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 ratingsComputer Science: A Concise Introduction Rating: 4 out of 5 stars4/5Cyber Security Consultants Playbook Rating: 0 out of 5 stars0 ratingsAn Ultimate Guide to Kali Linux for Beginners Rating: 3 out of 5 stars3/5The Basics of Hacking and Penetration Testing: Ethical Hacking and Penetration Testing Made Easy Rating: 4 out of 5 stars4/5The Programmer's Brain: What every programmer needs to know about cognition Rating: 5 out of 5 stars5/5Computer Organization and Design: The Hardware / Software Interface Rating: 4 out of 5 stars4/5Supercommunicator: Explaining the Complicated So Anyone Can Understand Rating: 3 out of 5 stars3/5Handbook of Digital Forensics and Investigation Rating: 4 out of 5 stars4/5AWS Certified Cloud Practitioner: Study Guide with Practice Questions and Labs Rating: 5 out of 5 stars5/5COMPUTER SCIENCE FOR ROOKIES Rating: 0 out of 5 stars0 ratingsA Civic Technologist's Practice Guide Rating: 0 out of 5 stars0 ratingsWindows Registry Forensics: Advanced Digital Forensic Analysis of the Windows Registry Rating: 4 out of 5 stars4/5CompTIA Network+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Exam N10-008 Rating: 0 out of 5 stars0 ratingsInkscape Beginner’s Guide Rating: 5 out of 5 stars5/5Cybersecurity for Beginners : Learn the Fundamentals of Cybersecurity in an Easy, Step-by-Step Guide: 1 Rating: 0 out of 5 stars0 ratingsHacking Essentials - The Beginner's Guide To Ethical Hacking And Penetration Testing Rating: 3 out of 5 stars3/5Health Informatics: Practical Guide 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