I didn’t know there was so much I didn’t know!
—attendee at a recent offering of this seminar
Locations, Dates, and Prices
This is a one-time special event that will be taught for 3 days beginning January 30, 2012 in the DFW Texas area.
The price is US$1,875 per student. Group discounts are available.
About This Seminar
SQL is ubiquitous. But SQL is complicated, difficult, and error prone (much more so than SQL advocates would have you believe), and testing can never be exhaustive. So to have any hope of writing correct SQL, you must follow some discipline. What discipline? Answer: The discipline of using SQL relationally. But what does this mean? Isn’t SQL relational anyway?
Well, of course SQL is the standard language for use with relational databases—but that doesn’t make it relational! The sad truth is, SQL departs from relational theory in all too many ways; duplicate rows and nulls provide two obvious examples, but they’re not the only ones. Thus, systems based on SQL give you rope to hang yourself, as it were. So if you don’t want to hang yourself, you need to understand relational theory (what it is and why); you need to know about SQL’s departures from that theory; and you need to know how to avoid the problems they can cause. In a word, you need to use SQL relationally. Then you can behave as if SQL truly were relational, and you can enjoy the benefits of working with what is, in effect, a truly relational system.
Of course, a seminar like this wouldn’t be needed if everyone already used SQL relationally—but they don’t. On the contrary, there’s a huge amount of bad practice to be observed in current SQL usage. Such practice is even recommended in textbooks and other publications, by writers who really ought to know better; in fact, a review of the literature in this regard is a pretty dispiriting exercise. The relational model first saw the light of day in 1969—yet here we are, over 40 years later, and it still doesn’t seem to be very well understood by the database community at large. Partly for such reasons, this seminar uses the relational model itself as an organizing principle; it discusses various features of the model in depth, and shows in every case how best to use SQL to implement the feature in question. Note: Classroom exercises are an integral part of the seminar, and attendee discussion and interaction are encouraged.
About this Revised Version
This seminar is a revised version of an earlier seminar with the title How to Write Correct SQL and Know It: A Relational Approach to SQL. The overall objective remains the same, of course—using SQL relationally is still the emphasis—but the seminar has been revised throughout to reflect, among other things, experience gained from teaching the earlier version. New material has been added (including, importantly, a discussion of how to deal with missing information without using nulls); examples have been expanded and improved; and the treatment of SQL has been upgraded to cover recent changes to the SQL standard.
On completion of this seminar, attendees will:
- Appreciate how relational principles provide SQL’s logical underpinnings
- Understand the breadth and depth of those principles
- Know how to formulate complex SQL code with confidence that it is correct
- Generally, be able to use SQL relationally
Who Should Attend
This seminar is targeted to the following audiences:
- Database application designers and implementers
- Information modelers and database designers
- Data and database administrators
- Computer science professors specializing in database matters
- DBMS designers, implementers, and other vendor personnel
- Database consultants
- People responsible for DBMS product evaluation and acquisition
The seminar is not meant for beginners. Attendees will be expected to have at least an elementary familiarity with database concepts in general and the SQL language in particular. Attendees will also be expected to attempt a number of pencil and paper exercises in class. Solutions to those exercises will be discussed in class as well.
What You Get
Attendees will receive:
- Three days (18 classroom hours) with Chris Date.
- A workbook containing copies of the speaker’s slides.
- A copy of SQL and Relational Theory: How to Write Accurate SQL Code.
- Setting the scene
- Codd’s relational model
- SQL terminology vs. relational terminology
- Model vs. implementation
- Properties of relations
- Base vs. derived relations
- Relations vs. relvars
- The Third Manifesto and Tutorial D
- Wittgenstein’s dictum
- Domains are types
- Types and operators
- System vs. user defined types
- Scalar vs. nonscalar types
- Scalar types in SQL
- SQL type checking and coercion
- “Possibly nondeterministic” expressions
- SQL row and table types
- What’s a tuple?
- Rows in SQL
- What’s a relation?
- Relations are n-dimensional
- Relational comparisons
- TABLE_DUM and TABLE_DEE
- Tables in SQL
- A column naming discipline
- What’s wrong with duplicates?
- Avoiding duplicates in SQL
- What’s wrong with nulls?
- Avoiding nulls in SQL
- A remark on outer join
- Implications and ramifications
- Data definition
- Updating is set level
- Relational assignment
- D_INSERT, I_DELETE, and other shorthands
- Candidate and foreign keys
- Tables and propositions
- The Closed World Assumption
- Importance of closure
- Relation type inference rules
- Attribute renaming
- Restriction, projection, join
- Union, intersection, difference
- Primitive operators
- WITH and complex expressions
- What expressions mean
- Evaluating SQL expressions
- Expression optimization
- Exclusive union
- Semijoin and semidifference
- Image relations
- Aggregation and summarization
- Relation valued attributes
- “What if” queries
- What about ORDER BY?
- Recursive queries
- Type constraints
- Type constraints in SQL
- Database constraints
- Database constraints in SQL
- The role of transactions
- Immediate vs. deferred checking
- Multiple assignment
- Constraints vs. predicates
- The Golden Rule
- Correctness vs. consistency
- Views are relvars
- The Principle of Interchangeability
- Views and predicates
- Retrieval operations
- Views and constraints
- Updating operations
- What are views really for?
- Views and snapshots
- Natural language is often ambiguous
- Propositions and predicates
- Truth functional completeness
- Quantification: EXISTS, FORALL, UNIQUE
- Range variables and correlation names
- Calculus expressions
- Queries and constraints
- SQL support
- Transforming expressions
- Relational completeness
- Important identities
- SQL and implication
- SQL and FORALL
- Correlated subqueries
- Naming subexpressions
- Dealing with ambiguity
- Using COUNT
- ALL or ANY comparisons
- GROUP BY and HAVING
- Explicit tables
- Dot qualification
- Range variables
- Table, row, and scalar subqueries
- “Possibly nondeterministic” expressions
- Empty set issues
- A BNF grammar for SQL
- Why databases must be relational
- Theory is practical
- The relational model defined
- What a database really is
- The relational model vs. others
- SQL departures from the relational model
- What remains to be done?
- Vertical and horizontal decomposition
- Varieties of missing information
- Constraints and queries
- “Don’t know” answers
About Chris Date
C. J. Date is the world’s best known relational advocate. He is best known for his book An Introduction to Database Systems (8ed, Addison-Wesley, 2004), which has sold some 850,000 copies and is used by several hundred colleges and universities worldwide. He is one of the inventors of our database industry. Mr. Date was introduced into the Computing Industry Hall of Fame in 2004. He enjoys a reputation that is second to none for his ability to communicate complex technical subjects in a clear and understandable fashion.