Joe Celko - Authors & Columnists - InformationWeek

InformationWeek is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them.Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

 Joe Celko

Profile of Joe Celko

News & Commentary Posts: 19
Articles by Joe Celko

Celko SQL Puzzle: Calculating Commissions

How many ways can you come up with to keep track of commission amounts?... One way of spotting a design problem is when you have to use a VIEW or CTE over and over to answer basic questions. This implies that the schema has spread information over many tables that should be in one table or that it has aggregated data in one row that should be split out into multiple rows.

Post a Comment

Celko's Theater-Seat-Assignment SQL Puzzle

In many situations, auxiliary tables are faster and more appropriate than SQL with computations. To illustrate, consider a classic problem. You have a theater and a bunch of seats you wish to sell for a performance (or think of seats for an airline flight). The seats have a sequential serial number from 1 to (n) for inventory. But in the theater building and on the tickets, the seats are arranged in rows of (k) seats and referenced by the pair (row_nbr, seat_within_row_nbr).

Post a Comment

Celko on SQL: Auxiliary Tables vs. Declarative Coding

Auxiliary tables are not only portable across SQL environments and adaptable to external software, they're often a faster, better choice than SQL with computations. And as chips and hardware get faster and cheaper, the auxiliary table approach will make even more sense.

Post a Comment

And the 'Email Validation' SQL Puzzle Winner Is...

The winner of last week's 'Email Address Validation' SQL puzzle is "Guest" (see comments), because he/she bothered to do the research and come up with an answer that is generic enough to port to any SQL dialect with a SIMILAR TO or a regexp() function. So, "Guest" please email me with your snail mail address (and some attempt to validate your SQL mastery/identity) and I'll send you one of my books. Here's my answer to last week's puzzle...

Post a Comment

Celko's Email-Address-Validation SQL Puzzle

You've probably noticed that many Web sites use the customer's email addresses as an identifier. We have all received messages something like this: "Thanks for signing up for 'The Leech Farmer's Monthly' email newsletter! We are sending you a confirmation at your email address with your temporary password." How many ways can you write CHECK() column constraint to validate an email address?

Post a Comment

Celko's 'Can't Be Your Own Supervisor' SQL Puzzle

A small database has the following business rules: 1) Every person in the database is uniquely defined by a single key, their user_id; 2) Everyone is assigned a job category, call them 'A', 'B' and 'X'; 3) Everyone in job category 'X' has a supervisor who must be in either job category 'A' or job category 'B'; 4) Nobody can be their own supervisor. One proposal was to divide job category 'X' into two, call them 'XA' and 'XB' respectively. All the 'XA' people would have 'A' supervisors, and all

Post a Comment

Cooking an old puzzle

I just got an email about Puzzle #11 in my old book SQL PUZZLES & ANSWER from Rainer Gemulla at TU Dresden, Fak. Informatik, Institut SyA, in Dresden, Germany. It is a very nice cook and it is embarassing to see how needlessly complex the other answers were:

Post a Comment

More on streaming databases

There is a good article on streaming databases with lots of product names and stuff suitable for googling inthe current issue of INTELLIGENT ENTERPRISE.

Post a Comment

An Old Celko Puzzle

If you go over to, you will find a letter to the editor from someone named PV about an old column of mine. Here is the jist of it: Back in June of 1996, Jack Wells submitted this SQL problem to my SQL FOR SMARTIES column.

Post a Comment

Hello everyone!

INTELLIGENT ENTERPRISE once more changed format at the end of last year and my long-time column went away. However CMP asked me if I would like to do a blog on SQL, databases and the other things that interests me.

Post a Comment
2021 State of ITOps and SecOps Report
2021 State of ITOps and SecOps Report
This new report from InformationWeek explores what we've learned over the past year, critical trends around ITOps and SecOps, and where leaders are focusing their time and efforts to support a growing digital economy. Download it today!
InformationWeek Is Getting an Upgrade!

Find out more about our plans to improve the look, functionality, and performance of the InformationWeek site in the coming months.

Remote Work Tops SF, NYC for Most High-Paying Job Openings
Jessica Davis, Senior Editor, Enterprise Apps,  7/20/2021
Blockchain Gets Real Across Industries
Lisa Morgan, Freelance Writer,  7/22/2021
Seeking a Competitive Edge vs. Chasing Savings in the Cloud
Joao-Pierre S. Ruth, Senior Writer,  7/19/2021
Register for InformationWeek Newsletters
Current Issue
Monitoring Critical Cloud Workloads Report
In this report, our experts will discuss how to advance your ability to monitor critical workloads as they move about the various cloud platforms in your company.
White Papers
Twitter Feed
Sponsored Live Streaming Video
Everything You've Been Told About Mobility Is Wrong
Attend this video symposium with Sean Wisdom, Global Director of Mobility Solutions, and learn about how you can harness powerful new products to mobilize your business potential.
Sponsored Video
Flash Poll