SQL All-In-One For Dummies, 3rd Edition
Published by: John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030-5774, www.wiley.com
Copyright 2019 by John Wiley & Sons, Inc., Hoboken, New Jersey
Published simultaneously in Canada
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without the prior written permission of the Publisher. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions
.
Trademarks: Wiley, For Dummies, the Dummies Man logo, Dummies.com, Making Everything Easier, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and may not be used without written permission. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc. is not associated with any product or vendor mentioned in this book.
LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND THE AUTHOR MAKE NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CONTENTS OF THIS WORK AND SPECIFICALLY DISCLAIM ALL WARRANTIES, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE. NO WARRANTY MAY BE CREATED OR EXTENDED BY SALES OR PROMOTIONAL MATERIALS. THE ADVICE AND STRATEGIES CONTAINED HEREIN MAY NOT BE SUITABLE FOR EVERY SITUATION. THIS WORK IS SOLD WITH THE UNDERSTANDING THAT THE PUBLISHER IS NOT ENGAGED IN RENDERING LEGAL, ACCOUNTING, OR OTHER PROFESSIONAL SERVICES. IF PROFESSIONAL ASSISTANCE IS REQUIRED, THE SERVICES OF A COMPETENT PROFESSIONAL PERSON SHOULD BE SOUGHT. NEITHER THE PUBLISHER NOR THE AUTHOR SHALL BE LIABLE FOR DAMAGES ARISING HEREFROM. THE FACT THAT AN ORGANIZATION OR WEBSITE IS REFERRED TO IN THIS WORK AS A CITATION AND/OR A POTENTIAL SOURCE OF FURTHER INFORMATION DOES NOT MEAN THAT THE AUTHOR OR THE PUBLISHER ENDORSES THE INFORMATION THE ORGANIZATION OR WEBSITE MAY PROVIDE OR RECOMMENDATIONS IT MAY MAKE. FURTHER, READERS SHOULD BE AWARE THAT INTERNET WEBSITES LISTED IN THIS WORK MAY HAVE CHANGED OR DISAPPEARED BETWEEN WHEN THIS WORK WAS WRITTEN AND WHEN IT IS READ.
For general information on our other products and services, please contact our Customer Care Department within the U.S. at 877-762-2974, outside the U.S. at 317-572-3993, or fax 317-572-4002. For technical support, please visit https://hub.wiley.com/community/support/dummies
.
Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with standard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://booksupport.wiley.com
. For more information about Wiley products, visit www.wiley.com
.
Library of Congress Control Number: 2019934589
ISBN 978-1-119-56961-9 (pbk); ISBN 978-1-119-56960-2 (ebk); ISBN 978-1-119-56959-6 (ebk)
SQL All-In-One For Dummies
To view this book's Cheat Sheet, simply go to www.dummies.com and search for SQL All-In-One For Dummies Cheat Sheet in the Search box.
Table of Contents
List of Tables
- Book 1 Chapter 4
- Book 1 Chapter 5
- Book 1 Chapter 6
- Book 2 Chapter 2
- Book 2 Chapter 3
- Book 2 Chapter 4
- Book 3 Chapter 1
- Book 3 Chapter 2
- Book 3 Chapter 3
- Book 3 Chapter 4
- Book 4 Chapter 1
- Book 4 Chapter 2
- Book 4 Chapter 4
- Book 6 Chapter 3
List of Illustrations
- Book 1 Chapter 1
- Book 1 Chapter 2
- Book 1 Chapter 3
- Book 1 Chapter 5
- Book 2 Chapter 1
- Book 2 Chapter 2
- Book 2 Chapter 3
- Book 3 Chapter 2
- Book 3 Chapter 3
- Book 4 Chapter 1
- Book 5 Chapter 2
- Book 5 Chapter 4
- Book 5 Chapter 5
- Book 5 Chapter 7
- Book 7 Chapter 1
- Book 7 Chapter 3
Guide
Pages
Introduction
SQL is the internationally recognized standard language for dealing with data in relational databases. Developed by IBM, SQL became an international standard in 1986. The standard was updated in 1989, 1992, 1999, 2003, 2008, 2011, and 2016. It continues to evolve and gain capability. Database vendors continually update their products to incorporate the new features of the ISO/IEC standard. (For the curious out there, ISO is the International Organization for Standardization, and IEC is the International Electrotechnical Commission.)
SQL isnt a general-purpose language, such as C++ or Java. Instead, its strictly designed to deal with data in relational databases. With SQL, you can carry out all the following tasks:
- Create a database, including all tables and relationships.
- Fill database tables with data.
- Change the data in database tables.
- Delete data from database tables.
- Retrieve specific information from database tables.
- Grant and revoke access to database tables.
- Protect database tables from corruption due to access conflicts or user mistakes.
About This Book
This book isnt just about SQL; its also about how SQL fits into the process of creating and maintaining databases and database applications. In this book, I cover how SQL fits into the larger world of application development and how it handles data coming in from other computers, which may be on the other side of the world or even in interplanetary space.
Here are some of the things you can do with this book:
- Create a model of a proposed system and then translate that model into a database.
- Find out about the capabilities and limitations of SQL.
- Discover how to develop reliable and maintainable database systems.
- Create databases.
- Speed database queries.
- Protect databases from hardware failures, software bugs, and Internet attacks.
- Control access to sensitive information.
- Write effective database applications.
- Deal with data from a variety of nontraditional data sources by using XML.
Foolish Assumptions
I know that this is a For Dummies book, but I dont really expect that youre a dummy. In fact, I assume that youre a very smart person. After all, you decided to read this book, which is a sign of high intelligence indeed. Therefore, I assume that you may want to do a few things, such as re-create some of the examples in the book. You may even want to enter some SQL code and execute it. To do that, you need at the very least an SQL editor and more likely also a database management system (DBMS) of some sort. Many choices are available, both proprietary and open source. I mention several of these products at various places throughout the book but dont recommend any one in particular. Any product that complies with the ISO/IEC international SQL standard should be fine.
Take claims of ISO/IEC compliance with a grain of salt, however. No DBMS available today is 100 percent compliant with the ISO/IEC SQL standard. For that reason, some of the code examples I give in this book may not work in the particular SQL implementation that youre using. The code samples I use in this book are consistent with the international standard rather than with the syntax of any particular implementation unless I specifically state that the code is for a particular implementation.
Next page