Joe Celko

Joe Celko's SQL Puzzles and Answers, Second Edition

In this complete revision and expansion of his first SQL Puzzles book, Joe Celko challenges you with his trickiest puzzles—and then helps solve them with a variety of solutions and explanations. Joe demonstrates the thought processes that are involved in attacking a problem from an SQL perspective to help advanced database programmers solve the puzzles you frequently face. These techniques not only help with the puzzle at hand, but help develop the mindset needed to solve the many difficult SQL puzzles you face every day. Of course, part of the fun is to see whether or not you can write better solutions than Joe’s.

Audience
Database programmers with a good knowledge of SQL

,

Published: October 2006

Imprint: Morgan Kaufmann

ISBN: 978-0-08-049168-4

Contents

  • PUZZLE 01: FISCAL YEAR TABLES PUZZLE 02: ABSENTEESPUZZLE 03: THE ANESTHESIA PUZZLEPUZZLE 04: SECURITY BADGES PUZZLE 05: ALPHA DATA PUZZLE 06: HOTEL RESERVATIONSPUZZLE 07: KEEPING A PORTFOLIO PUZZLE 08: SCHEDULING PRINTERS PUZZLE 09: AVAILABLE SEATS PUZZLE PUZZLE 10: WAGES OF SIN:PUZZLE 11: WORK ORDER PUZZLE 12: CLAIMS STATUS PUZZLE 13: TEACHERS PUZZLE 14: TELEPHONEPUZZLE 15: FIND THE LAST TWO SALARIESPUZZLE 16: MECHANICS PUZZLE 17: EMPLOYMENT AGENCYPUZZLE 18: JUNK MAIL PUZZLE 19: TOP SALESMENPUZZLE 20: TEST RESULTSPUZZLE 21: AIRPLANES AND PILOTSPUZZLE 22: LANDLORDPUZZLE 23: MAGAZINE PUZZLE 24 ONE IN TENPUZZLE 25: MILESTONE PUZZLE 26: DATAFLOW DIAGRAMSPUZZLE 27: FINDING EQUAL SETSPUZZLE 28: CALCULATE THE SINE FUNCTION PUZZLE 29: FIND THE MODE COMPUTATION PUZZLE 30: AVERAGE SALES WAIT PUZZLE 31: BUYING ALL THE PRODUCTS PUZZLE 32: COMPUTING TAXESPUZZLE 33: COMPUTING DEPRECIATION PUZZLE 34: CONSULTANT BILLING PUZZLE 35: REQUISITIONSPUZZLE 36: DOUBLE DUTYPUZZLE 37: MOVING AVERAGE PUZZLE 38: JOURNAL UPDATING PUZZLE 39: INSURANCE LOSSES PUZZLE 40: PERMUTATIONS:PUZZLE 41: BUDGETING PUZZLE 42: COUNTING FISH PUZZLE 43: GRADUATION PUZZLE 44: PAIRS OF STYLESPUZZLE 45: PEPPERONI PIZZA PUZZLE 46: SALES PROMOTIONSPUZZLE 47: BLOCKS OF SEATS PUZZLE 48: UN-GROUPINGPUZZLE 49: WIDGET COUNTPUZZLE 50: TWO OF THREEPUZZLE 51: BUDGET VERSUS ACTUALPUZZLE 52: PERSONNEL PROBLEMPUZZLE 53: COLLAPSING A TABLE BY COLUMNSPUZZLE 54: POTENTIAL DUPLICATES PUZZLE 55: PLAYING THE PONIESPUZZLE 56: HOTEL ROOM NUMBERSPUZZLE 57: GAPS - 1 PUZZLE 58: GAPS - 2 PUZZLE 59: MERGING TIME PERIODS PUZZLE 60: BARCODES PUZZLE 61: SORTING A STRING PUZZLE 62: REPORT FORMATTING PUZZLE 63: CONTIGUOUS GROUPINGS PUZZLE 64: BOXES PUZZLE 65: AGE RANGES FOR PRODUCTSPUZZLE 66: FOUR CONSECUTIVE ABSENCES PUZZLE 67: STABLE MARRIAGES PROBLEMPUZZLE 68: CATCHING THE NEXT BUS PUZZLE 69: LIFO-FIFO INVENTORYPUZZLE 70: STOCK TRENDSPUZZLE 71: CALCULATIONS PUZZLE 72: SCHEDULING SERVICE CALLSPUZZLE 73: A LITTLE DATA SCRUBBINGPUZZLE 74: DERIVED TABLES OR NOT?PUZZLE 75: FINDING A PUB

Advertisement

advert image