1. Trang chủ
  2. » Tất cả

(ebook pdf) Teach Yourself SQL in 21 Days - tủ tài liệu bách khoa

586 1 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 586
Dung lượng 1,25 MB

Nội dung

Teach Yourself SQL in 21 Days, Second Edition Table of Contents: Introduction Week at a Glance Day Introduction to SQL Day Introduction to the Query: The SELECT Statement Day Expressions, Conditions, and Operators Day Functions: Molding the Data You Retrieve Day Clauses in SQL Day Joining Tables Day Subqueries: The Embedded SELECT Statement Week in Review Week at a Glance Day Manipulating Data Day Creating and Maintaining Tables Day 10 Creating Views and Indexes Day 11 Controlling Transactions Day 12 Database Security Day 13 Advanced SQL Topics Day 14 Dynamic Uses of SQL Week in Review Week at a Glance Day 15 Streamlining SQL Statements for Improved Performance Day 16 Using Views to Retrieve Useful Information from the Data Dictionary Day 17 Using SQL to Generate SQL Statements Day 18 PL/SQL: An Introduction Day 19 Transact-SQL: An Introduction Day 20 SQL*Plus Day 21 Common SQL Mistakes/Errors and Resolutions Week in Review Appendixes A Glossary of Common SQL Statements B Source Code Listings for the C++ Program Used on Day 14 C Source Code Listings for the Delphi Program Used on Day 14 D Resources E ASCII Table F Answers to Quizzes and Excercises © Copyright, Macmillan Computer Publishing All rights reserved Teach Yourself SQL in 21 Days, Second Edition Acknowledgments A special thanks to the following individuals: foremost to my loving wife, Tina, for her tolerance and endless support, to Dan Wilson for his contributions, and to Thomas McCarthy at IUPUI Also, thank you Jordan for your encouragement over the past few years Ryan K Stephens Special thanks to my wife for putting up with me through this busiest of times I apologize to my mom for not seeing her as often as I should (I'll make it up to you) Also, thanks to my loyal dog, Toby He was with me every night and wouldn't leave my side Ronald Plew Special thanks to the following people: Jeff Perkins, David Blankenbeckler, Shannon Little, Jr., Clint and Linda Morgan, and Shannon and Kaye Little This book is dedicated to my beautiful wife, Becky I am truly appreciative to you for your support, encouragement, and love Thanks for staying up with me during all those late-night sessions You are absolutely the best Bryan Morgan Thanks to my family, Leslie, Laura, Kelly, Valerie, Jeff, Mom, and Dad Their support made working on this book possible Jeff Perkins About the Authors Ryan K Stephens Ryan K Stephens started using SQL as a programmer/analyst while serving on active duty in the Indiana Army National Guard Hundreds of programs later, Ryan became a database administrator He currently works for Unisys Federal Systems, where he is responsible for government-owned databases throughout the United States In addition to his full-time job, Ryan teaches SQL and various database classes at Indiana University-Purdue University Indianapolis He also serves part-time as a programmer for the Indiana Army National Guard Along with Ron Plew and two others, Ryan owns a U.S patent on a modified chess game Some of his interests include active sports, chess, nature, and writing Ryan lives in Indianapolis with his wife, Tina, and their three dogs, Bailey, Onyx, and Sugar Ronald R Plew Ronald R Plew is a database administrator for Unisys Federal Systems He holds a bachelor of science degree in business administration/management from the Indiana Institute of Technology He is an instructor for Indiana University-Purdue University Indianapolis where he teaches SQL and various database classes Ron also serves as a programmer for the Indiana Army National Guard His hobbies include collecting Indy 500 racing memorabilia He also owns and operates Plew's Indy 500 Museum He lives in Indianapolis with his wife, Linda They have four grown children (Leslie, Nancy, Angela, and Wendy) and eight grandchildren (Andy, Ryan, Holly, Morgan, Schyler, Heather, Gavin, and Regan) Bryan Morgan Bryan Morgan is a software developer with TASC, Inc., in Fort Walton Beach, Florida In addition to writing code and chasing the golf balls he hits, Bryan has authored several books for Sams Publishing including Visual J++ Unleashed, Java Developer's Reference, and Teach Yourself ODBC Programming in 21 Days He lives in Navarre, Florida, with his wife, Becky, and their daughter, Emma Jeff Perkins Jeff Perkins is a senior software engineer with TYBRIN Corporation He has been a program manager, team leader, project lead, technical lead, and analyst A graduate of the United States Air Force Academy, he is a veteran with more than 2,500 hours of flying time as a navigator and bombardier in the B-52 He has co-authored three other books, Teach Yourself NT Workstation in 24 Hours, Teach Yourself ODBC Programming in 21 Days, and Teach Yourself ActiveX in 21 Days Tell Us What You Think! As a reader, you are the most important critic and commentator of our books We value your opinion and want to know what we're doing right, what we could better, what areas you'd like to see us publish in, and any other words of wisdom you're willing to pass our way You can help us make strong books that meet your needs and give you the computer guidance you require Do you have access to CompuServe or the World Wide Web? Then check out our CompuServe forum by typing GO SAMS at any prompt If you prefer the World Wide Web, check out our site at http://www.mcp.com NOTE: If you have a technical question about this book, call the technical support line at 317-581-3833 or send e-mail to support@mcp.com As the team leader of the group that created this book, I welcome your comments You can fax, e-mail, or write me directly to let me know what you did or didn't like about this book as well as what we can to make our books stronger Here's the information: FAX: 317-581-4669 E-mail: enterprise_mgr@sams.mcp.com Mail: Rosemarie Graham Comments Department Sams Publishing 201 W 103rd Street Indianapolis, IN 46290 Introduction Who Should Read This Book? Late one Friday afternoon your boss comes into your undersized cubicle and drops a new project on your desk This project looks just like the others you have been working on except it includes ties to several databases Recently your company decided to move away from homegrown, flat-file data and is now using a relational database You have seen terms like SQL, tables, records, queries, and RDBMS, but you don't remember exactly what they all mean You notice the due date on the program is three, no, make that two, weeks away (Apparently it had been on your boss's desk for a week!) As you begin looking for definitions and sample code to put those definitions into context, you discover 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 business setting Overview The first 14 days of this book show you how to use SQL to incorporate the power of modern relational databases into your code By the end of Week 1, you will be able to use basic SQL commands to retrieve selected data NOTE: If you are familiar with the basics and history of SQL, we suggest you skim the first week's chapters and begin in earnest with Day 8, "Manipulating Data." At the end of Week 2, you will be able to use the more advanced features of SQL, such as stored procedures and triggers, to make your programs more powerful Week teaches you how to streamline SQL code; use the data dictionary; use SQL to generate more SQL code; work with PL/SQL, Transact-SQL, and SQL*Plus; and handle common SQL mistakes and errors The syntax of SQL is explained and then brought to life in examples using Personal Oracle7, Microsoft Query, and other database tools You don't need access to any of these products to use this book it can stand alone as an SQL syntax reference However, using one of these platforms and walking though the examples will help you understand the nuances Conventions Used in This Book This book uses the following typeface conventions: ● ● Menu names are separated from menu options by a vertical bar (|) For example, File | Open means "select the Open option from the File menu." New terms appear in italic ● All code in the listings that you type in (input) appears in boldface monospace Output appears in standard monospace ● The input label and output label also identify the nature of the code ● Many code-related terms within the text also appear in monospace ● Paragraphs that begin with the analysis label explain the preceding code sample ● The syntax label identifies syntax statements The following special design features enhance the text: NOTE: Notes explain interesting or important points that can help you understand SQL concepts and techniques TIP: Tips are little pieces of information to begin to help you in real-world situations Tips often offer shortcuts or information to make a task easier or faster WARNING: Warnings provide information about detrimental performance issues or dangerous errors Pay careful attention to Warnings © Copyright, Macmillan Computer Publishing All rights reserved Teach Yourself SQL in 21 Days, Second Edition Week At A Glance Let's Get Started Week introduces SQL from a historical and theoretical perspective The first statement you learn about is the SELECT statement, which enables you to retrieve data from the database based on various user-specified options Also during Week you study SQL functions, query joins, and SQL subqueries (a query within a query) Many examples help you understand these important topics These examples use Oracle7, Sybase SQL Server, Microsoft Access, and Microsoft Query and highlight some of the similarities and differences among the products The content of the examples should be useful and interesting to a broad group of readers © Copyright, Macmillan Computer Publishing All rights reserved Teach Yourself SQL in 21 Days, Second Edition - Day Introduction to SQL A Brief History of SQL The history of SQL begins in an IBM laboratory in San Jose, California, where SQL was developed in the late 1970s The initials stand for Structured Query Language, and the language itself is often referred to as "sequel." It was originally developed for IBM's DB2 product (a relational database management system, or RDBMS, that can still be bought today for various platforms and environments) In fact, SQL makes an RDBMS possible SQL is a nonprocedural language, in contrast to the procedural or thirdgeneration languages (3GLs) such as COBOL and C that had been created up to that time NOTE: Nonprocedural means what rather than how For example, SQL describes what data to retrieve, delete, or insert, rather than how to perform the operation The characteristic that differentiates a DBMS from an RDBMS is that the RDBMS provides a set-oriented database language For most RDBMSs, this set-oriented database language is SQL Set oriented means that SQL processes sets of data in groups Two standards organizations, the American National Standards Institute (ANSI) and the International Standards Organization (ISO), currently promote SQL standards to industry The ANSI-92 standard is the standard for the SQL used throughout this book Although these standard-making bodies prepare standards for database system designers to follow, all database products differ from the ANSI standard to some degree In ... flying time as a navigator and bombardier in the B-52 He has co-authored three other books, Teach Yourself NT Workstation in 24 Hours, Teach Yourself ODBC Programming in 21 Days, and Teach Yourself. .. Computer Publishing All rights reserved Teach Yourself SQL in 21 Days, Second Edition - Day Introduction to SQL A Brief History of SQL The history of SQL begins in an IBM laboratory in San Jose,... 16 Using Views to Retrieve Useful Information from the Data Dictionary Day 17 Using SQL to Generate SQL Statements Day 18 PL /SQL: An Introduction Day 19 Transact -SQL: An Introduction Day 20 SQL* Plus

Ngày đăng: 07/11/2019, 13:51

TỪ KHÓA LIÊN QUAN