Includes Coverage of Oracle and Microsoft SQL Implementations
In just 24 lessons of one hour or less, Sams Teach Yourself SQL in 24 Hours, Sixth Edition, helps you use SQL to build effective databases, efficiently retrieve data, and manage everything from performance to security.
This book’s straightforward, step-by-step approach shows you how to work with database structures, objects, queries, tables, and more. In just hours, you will be applying advanced techniques, including views, transactions, web connections, and powerful Oracle and SQL Server extensions. Every lesson builds on what you’ve already learned, giving you a rock-solid foundation for real-world success.
Step-by-step instructions carefully walk you through the most common SQL tasks.
Practical, hands-on examples show you how to apply what you learn.
Quizzes and exercises help you test your knowledge and stretch your skills.
Notes and tips point out shortcuts and solutions.
Learn how to…
• Define efficient database structures and objects
• “Normalize” raw databases into logically organized tables
• Edit relational data and tables with DML
• Manage transactions
• Write effective, well-performing queries
• Categorize, summarize, sort, group, and restructure data
• Work with dates and times
• Join tables in queries, use subqueries, and combine multiple queries
• Master powerful query optimization techniques
• Administer databases and manage users
• Secure databases and protect data
• Use views, synonyms, and the system catalog
• Extend SQL to the enterprise and Internet
• Master important Oracle and Microsoft extensions to ANSI SQL
Register your product at informit.com/register for convenient access to downloads, updates, and corrections as they become available.
Part I: An SQL Concepts Overview
HOUR 1: Welcome to the World of SQL
SQL Definition and History
Types of SQL Commands
Canary Airlines: The Database Used in This Book
Part II: Building Your Database
HOUR 2: Defining Data Structures
What Is Data?
Basic Data Types
HOUR 3: Managing Database Objects
Database Objects and Schema
Tables: The Primary Storage for Data
HOUR 4: The Normalization Process
Normalizing a Database
Denormalizing a Database
HOUR 5: Manipulating Data
Overview of Data Manipulation
Populating Tables with New Data
Updating Existing Data
Deleting Data from Tables
HOUR 6: Managing Database Transactions
What Is a Transaction?
Poor Transactional Control
Part III: Getting Effective Results from Queries
HOUR 7: Introduction to Database Queries
The SELECT Statement
Fundamentals of Query Writing
HOUR 8: Using Operators to Categorize Data
What Is an Operator in SQL?
HOUR 9: Summarizing Data Results from a Query
HOUR 10: Sorting and Grouping Data
Why Group Data?
The GROUP BY Clause
GROUP BY Versus ORDER BY
CUBE and ROLLUP Expressions
The HAVING Clause
HOUR 11: Restructuring the Appearance of Data
ANSI Character Functions
Common Character Functions
Miscellaneous Character Functions
Combining Character Functions
HOUR 12: Understanding Dates and Times
How Is a Date Stored?
Part IV: Building Sophisticated Database Queries
HOUR 13: Joining Tables in Queries
Selecting Data from Multiple Tables
HOUR 14: Using Subqueries to Define Unknown Data
What Is a Subquery?
HOUR 15: Combining Multiple Queries into One
Single Queries Versus Compound Queries
Compound Query Operators
Using ORDER BY with a Compound Query
Using GROUP BY with a Compound Query
Retrieving Accurate Data
Part V: SQL Performance Tuning
HOUR 16: Using Indexes to Improve Performance
What Is an Index?
How Do Indexes Work?
The CREATE INDEX Command
Types of Indexes
When Should Indexes Be Considered?
When Should Indexes Be Avoided?
Altering an Index
Dropping an Index
HOUR 17: Improving Database Performance
What Is SQL Statement Tuning?
Database Tuning Versus SQL Statement Tuning
Formatting Your SQL Statement
Full Table Scans
Other Performance Considerations
Part VI: Using SQL to Manage Users and Security
HOUR 18: Managing Database Users
User Management in the Database
The Management Process
Tools Utilized by Database Users
HOUR 19: Managing Database Security
What Is Database Security?
What Are Privileges?
Controlling User Access
Controlling Privileges Through Roles
Part VII: Summarized Data Structures
HOUR 20: Creating and Using Views and Synonyms
What Is a View?
Updating Data Through a View
Dropping a View
Performance Impact of Nested Views
What Is a Synonym?
HOUR 21: Working with the System Catalog
What Is the System Catalog?
How Is the System Catalog Created?
What Is Contained in the System Catalog?
System Catalog Tables by Implementation
Querying the System Catalog
Updating System Catalog Objects
Part VIII: Applying SQL Fundamentals in Today’s World
HOUR 22: Advanced SQL Topics
Stored Procedures and Functions
Using SQL to Generate SQL
Direct Versus Embedded SQL
Windowed Table Functions
Working with XML
HOUR 23: Extending SQL to the Enterprise, the Internet, and the Intranet
SQL and the Enterprise
Accessing a Remote Database
SQL and the Internet
SQL and the Intranet
HOUR 24: Extensions to Standard SQL
Interactive SQL Statements
Part IX: Appendixes
APPENDIX A: Common SQL Commands
APPENDIX B: Installing Oracle and Microsoft SQL
Windows Installation Instructions for Oracle
Windows Installation Instructions for Microsoft SQL Server
APPENDIX C: Answers to Quizzes and Exercises
Hour 1, “Welcome to the World of SQL”
Hour 2, “Defining Data Structures”
Hour 3, “Managing Database Objects”
Hour 4, “The Normalization Process”
Hour 5, “Manipulating Data”
Hour 6, “Managing Database Transactions”
Hour 7, “Introduction to the Database Queries”
Hour 8, “Using Operators to Categorize Data”
Hour 9, “Summarizing Data Results from a Query”
Hour 10, “Sorting and Grouping Data”
Hour 11, “Restructuring the Appearance of Data”
Hour 12, “Understanding Dates and Times”
Hour 13, “Joining Tables in Queries”
Hour 14, “Using Subqueries to Define Unknown Data”
Hour 15, “Combining Multiple Queries into One”
Hour 16, “Using Indexes to Improve Performance”
Hour 17, “Improving Database Performance”
Hour 18, “Managing Database Users”
Hour 19, “Managing Database Security”
Hour 20, “Creating and Using Views and Synonyms”
Hour 21, “Working with the System Catalog”
Hour 22, “Advanced SQL Topics”
Hour 23, “Extending SQL to the Enterprise, the Internet, and the Intranet”
Hour 24, “Extensions to Standard SQL”
APPENDIX D: Bonus Exercises
APPENDIX E: Glossary