March 24, 1997

Finding Two Equal Sets of Data

Question: [Joe Celko’s Equal Sets Puzzle]Set theory has two symbols for subsets. One is a “horseshoe” on its side, which means that set A is contained within set B and

Dataflow Diagrams

Question: [Joe Celko’s Dataflow Diagrams Puzzle]Tom Bragg posted a version of this problem on the CASE Forum on CompuServe. You have a table of dataflow diagrams (DFDs), which has the

Pivoting Table Data — Horizontal Display

Question: [Joe Celko’s Milestones Puzzle]This puzzle, in a little different form, came from Brian Young. His system tracks a series of dates (milestones) for each particular type of service (tos)

Finding Exactly Two of Three — Conditions

Question: We are putting together a book with contributions from many Anthologies (identified by their contrnum). We want to find all Anthologies thathave articles in exactly two out of three

Finding Unique Data

Question: How would I change the following statement to yieldonly unique values? select * FROM WEBDBASE where ST = ‘#State#’ AND #SPECIALTY# = ‘x’; Answer: You can’t get unique values

Pattern Matching

Question: How can I use SQL to specify a query like the example below: select * from mytable where column like ‘a[bc]’This should match both “ab” and “ac” but not

Matching Employees’ Skills with Jobs

Question: [Joe Celko’s Employment Agency Puzzle]You are running an employment agency that has requests for jobs and applications from candidates. Both of these forms include a list of the skills