SitePoint
  • Premium
  • Library
  • Community
  • Jobs
  • Blog
LoginStart Free Trial
Simply SQL
Simply SQL
Notice of Rights
Notice of Liability
Trademark Notice
About the Author
About the Expert Reviewer
About the Technical Editors
About SitePoint
Who Should Read This Book?
The Challenges to Learning SQL
What’s in This Book?
How to Gain Help
The SitePoint Newsletters
Your Feedback
Conventions Used in This Book
Acknowledgments
SQL Statement Overview
Data Definition Language
Data Manipulation Language
Wrapping Up: an Introduction to SQL
The SELECT Statement
The SELECT and FROM Clauses
The WHERE Clause
The GROUP BY and HAVING Clauses
The ORDER BY Clause
Wrapping Up: the SELECT Statement
Why Start with the FROM Clause?
FROM One Table
FROM more than One Table Using JOINs
Real World Joins
Views
Subqueries and Derived Tables
Wrapping Up: the FROM Clause
Conditions
Shopping Carts
Operators
Compound Conditions with AND and OR
IN Conditions
Correlated Subqueries
EXISTS Conditions
WHERE Clause Performance
Wrapping Up: the WHERE Clause
Grouping is More than Sequencing
Out of Many, One
How GROUP BY Works
Rules for GROUP BY
Wrapping Up: the GROUP BY
HAVING Filters Group Rows
Wrapping Up: the HAVING Clause
SELECT in the Sequence of Execution
Which Columns Can Be Selected?
The Discussion Forum Application
Functions
Operators
The Dreaded, Evil Select Star
Wrapping Up: the SELECT Clause
ORDER BY Syntax
How ORDER BY Works
The Scope of ORDER BY
Wrapping Up: the ORDER BY Clause
An Overview of Data Types
Numeric Data Types
Character Data Types
Temporal Data Types
Column Constraints
Wrapping Up: SQL Data Types
Identity
Data Modelling
Primary Keys
UNIQUE Constraints
Foreign Keys
Natural versus Surrogate Keys
Wrapping Up: Relational Integrity
Joining to a Table Twice
Joining a Table to Itself
Implementing a Many-to-many Relationship: Keywords
Wrapping Up: Special Structures
Appendix A. Testing Environment
Appendix B. Sample Applications
Appendix C. Sample Scripts
Appendix D. SQL Keywords

Community Questions