Excerpt
Introduction Introduction
Over the past decade the landscape of information technology has drastically shifted to a data centric world. More than ever companies are looking for ways in which they can leverage their own data networks to make intelligent business decisions. This includes the ability to gather, store, and report effectively over possibly large sets of data in multiple formats. So the role of database administrators and developers have become strategically important in the proper implementation and care of these systems.
The cornerstone to any database project is the language that will be used in order to interact with the system. Fortunately, a consortium of entities has enacted a standard query language for database environments known as the ANSI SQL standard. This provides a commonality between all database querying languages by following this know standard and allows developers to learn the standard and then work on any given number of database systems with minor adjustments.
This book takes a focused approach on getting the reader the basics of the SQL language in order to allow them to have a solid foundation for future learning. Often in todays business environment, there is very little time to learn new things as our day to day functions consume large amounts of our time. By focusing on smaller lesson plans and logically segmenting the sections in a stepping stone fashion, the book will allow someone to learn the SQL language at their own pace and within their own schedule.
Who Should Read This Book?
This book is for people who want to learn the fundamentals of Structured Query Language (SQL) quickly. Through the use of countless examples, this book depicts all the major components of SQL, as well as options that are available with various database implementations. You should be able to apply what you learn here to relational databases in a traditional business setting.
How Is This Book Organized?
This book is divided into seven parts which logically break down the structure of ANSI SQL into easily learnable sections:
- Part I, comprised of the first seven lessons, discusses the basic concepts behind SQL and mainly focuses on the SQL query.
- Part II includes topics on the art of database design, such as creating databases and database objects properly, which is often the foundation of RDBMS application development.
- Part III focuses on data manipulation and using SQL to perform UPDATEs, INSERTs, and DELETEs of data within your database. These will be the staple commands that you will use on a day-to-day basis.
- Part IV is dedicated to database administration, which covers such topics as security, management, and performance, enabling you to maintain the integrity and performance of your database instance.
- Part V focuses on more advanced SQL objects such as triggers and stored procedures. Using these objects will allow you to perform more sophisticated data manipulation techniques that would otherwise be difficult in standard SQL syntax.
- Part VI covers more advanced SQL programming. Advanced SQL programming will allow you to perform more advanced queries and manipulation of the data within your database.
- Part VII presents you with SQL in various database implementations. SQL extensions such as PL/SQL allow you to take advantage of unique attributes within a particular database environment, such as Oracle.
- This book also contains six appendixes, which provide you with not only the answers to the exercises in each lesson but also common SQL functions and terms that you will need to learn.
After studying this book, you should have an excellent understanding of SQL and should know how to apply SQL in the real world.
Note - If you are familiar with the basics and history of SQL, we suggest you skim the first lesson and begin in earnest with Lesson 2 “Introducing the Query”.
The syntax of SQL is explained and then brought to life in examples using MySQL, which is the closest implementation of the ANSI SQL standard syntax, as well as Oracle Express edition, which demonstrates some of the extensions to ANSI SQL.
Conventions Used in This Book
This book uses the following typeface conventions:
- Menu names are separated from menu options by a comma. For example, File, Open means select the Open option from the File menu.
- New terms are set off by the icon and appear in italic.
- In some listings, weve included both the input and output. For these, all code that you type in (input) appears in boldface monospace . Output appears in standard monospace. The Combination icon indicates that both input and output appear in the code.
- The Input and Output icons also identify the nature of the code.
- Many code-related terms within the text also appear in monospace.
- Placeholders in code appear in italic monospace .
- When a line of code is too long to fit on one line of this book, it is broken at a convenient place and continued to the next line. A code continuation character precedes the continuation of a line of code. (You should type a line of code that has this character as one long line without breaking it.)
- Paragraphs that begin with the Analysis icon explain the preceding code example.
- The Syntax icon identifies syntax statements.
- Special design features enhance the text material:
Note - Notes explain interesting or important points that can help you understand SQL concepts and techniques.
Tip - Tips are little pieces of information that will help you in real-world situations. Tips often offer shortcuts to make a task easier or faster.
Caution - Cautions provide information about detrimental performance issues or dangerous errors. Pay careful attention to Cautions.
Using MySQL for Hands-on Exercises
We have chosen to use MySQL for hands-on exercises in this edition. In previous editions, we left it up to the reader to obtain access to any SQL implementation. We decided that it would be better to provide the reader with an open-source SQL database that allowed all readers to start on the same level with the same software. We chose MySQL because it is the most popular open-source database available today, and it is easy to download and use.
Unfortunately, MySQL does have its limitations. There are several features of standard SQL that are not supported by MySQL. We have attempted to distinguish between the exercises that support MySQL and those that do not. Those exercises that do not will mainly focus on using Oracle Enterprise edition, instead. The beauty of SQL is that it is a standard language, although each implementation does have its differences. After using MySQL to understand the basic fundamentals of SQL, you should be able to easily apply the concepts you have learned to any SQL implementation.
About the Book's Source Code
In the appendices, you will find the source code for creating all of the objects used throughout the book. This includes all of the tables and data that is used. Additionally, the source code will be available for download from the publishers website. This will allow you to simply cut and paste entries into your interface instead of spending the majority of your time typing and enable you to focus more clearly on the material.
© Copyright Pearson Education. All rights reserved.