Cover for Joe Celko's SQL Puzzles and Answers

Joe Celko's SQL Puzzles and Answers

A volume in The Morgan Kaufmann Series in Data Management Systems

Book • Second Edition2006

Author:

Joe Celko

Joe Celko's SQL Puzzles and Answers

A volume in The Morgan Kaufmann Series in Data Management Systems

Book • Second Edition2006

 

Cover for Joe Celko's SQL Puzzles and Answers

Author:

Joe Celko

About the book

Browse this book

Book description

Joe Celko's SQL Puzzles and Answers, Second Edition, challenges you with his trickiest puzzles and then helps solve them with a variety of solutions and explanations. Author Joe Ce ... read full description

Browse content

Table of contents

Actions for selected chapters

Select all / Deselect all

  1. Full text access
  2. Book chapterNo access

    Introduction

    Pages xv-xvii

  3. Book chapterAbstract only

    Puzzle 1 - Fiscal year tables

    Pages 1-3

  4. Book chapterAbstract only

    Puzzle 2 - Absentees

    Pages 4-8

  5. Book chapterAbstract only

    Puzzle 3 - The anesthesia puzzle

    Pages 9-15

  6. Book chapterAbstract only

    Puzzle 4 - Security badges

    Pages 16-18

  7. Book chapterAbstract only

    Puzzle 5 - Alpha data

    Pages 19-20

  8. Book chapterAbstract only

    Puzzle 6 - Hotel reservations

    Pages 21-23

  9. Book chapterAbstract only

    Puzzle 7 - Keeping a portfolio

    Pages 24-28

  10. Book chapterAbstract only

    Puzzle 8 - Scheduling printers

    Pages 29-33

  11. Book chapterAbstract only

    Puzzle 9 - Available seats

    Pages 34-36

  12. Book chapterAbstract only

    Puzzle 10 - Wages of sin

    Pages 37-44

  13. Book chapterAbstract only

    Puzzle 11 - Work orders

    Pages 45-47

  14. Book chapterAbstract only

    Puzzle 12 - Claims status

    Pages 48-52

  15. Book chapterAbstract only

    Puzzle 13 - Teachers

    Pages 53-55

  16. Book chapterAbstract only

    Puzzle 14 - Telephone

    Pages 56-59

  17. Book chapterAbstract only

    Puzzle 15 - Find the last two salaries

    Pages 60-68

  18. Book chapterAbstract only

    Puzzle 16 - Mechanics

    Pages 69-74

  19. Book chapterAbstract only

    Puzzle 17 - Employment agency

    Pages 75-79

  20. Book chapterAbstract only

    Puzzle 18 - Junk mail

    Pages 80-81

  21. Book chapterAbstract only

    Puzzle 19 - Top salespeople

    Pages 82-85

  22. Book chapterAbstract only

    Puzzle 20 - Test results

    Pages 86-87

  23. Book chapterAbstract only

    Puzzle 21 - Airplanes and pilots

    Pages 88-91

  24. Book chapterAbstract only

    Puzzle 22 - Landlord

    Pages 92-93

  25. Book chapterAbstract only

    Puzzle 23 - Magazine

    Pages 94-102

  26. Book chapterAbstract only

    Puzzle 24 - One in ten

    Pages 103-106

  27. Book chapterAbstract only

    Puzzle 25 - Milestone

    Pages 107-111

  28. Book chapterAbstract only

    Puzzle 26 - Dataflow diagrams

    Pages 112-114

  29. Book chapterAbstract only

    Puzzle 27 - Finding equal sets

    Pages 115-120

  30. Book chapterAbstract only

    Puzzle 28 - Calculate the sine function

    Pages 121-122

  31. Book chapterAbstract only

    Puzzle 29 - Find the mode computation

    Pages 123-125

  32. Book chapterAbstract only

    Puzzle 30 - Average sales wait

    Pages 126-128

  33. Book chapterAbstract only

    Puzzle 31 - Buying all the products

    Pages 129-131

  34. Book chapterAbstract only

    Puzzle 32 - Computing taxes

    Pages 132-136

  35. Book chapterAbstract only

    Puzzle 33 - Computing depreciation

    Pages 137-140

  36. Book chapterAbstract only

    Puzzle 34 - Consultant billing

    Pages 141-144

  37. Book chapterAbstract only

    Puzzle 35 - Inventory adjustments

    Pages 145-147

  38. Book chapterAbstract only

    Puzzle 36 - Double duty

    Pages 148-151

  39. Book chapterAbstract only

    Puzzle 37 - A moving average

    Pages 152-154

  40. Book chapterAbstract only

    Puzzle 38 - Journal updating

    Pages 155-157

  41. Book chapterAbstract only

    Puzzle 39 - Insurance losses

    Pages 158-162

  42. Book chapterAbstract only

    Puzzle 40 - Permutations

    Pages 163-168

  43. Book chapterAbstract only

    Puzzle 41 - Budgeting

    Pages 169-171

  44. Book chapterAbstract only

    Puzzle 42 - Counting fish

    Pages 172-175

  45. Book chapterAbstract only

    Puzzle 43 - Graduation

    Pages 176-178

  46. Book chapterAbstract only

    Puzzle 44 - Pairs of styles

    Pages 179-182

  47. Book chapterAbstract only

    Puzzle 45 - Pepperoni pizza

    Pages 183-185

  48. Book chapterAbstract only

    Puzzle 46 - Sales promotions

    Pages 186-189

  49. Book chapterAbstract only

    Puzzle 47 - Blocks of seats

    Pages 190-191

  50. Book chapterAbstract only

    Puzzle 48 - Ungrouping

    Pages 192-199

  51. Book chapterAbstract only

    Puzzle 49 - Widget count

    Pages 200-202

  52. Book chapterAbstract only

    Puzzle 50 - Two of three

    Pages 203-207

  53. Book chapterAbstract only

    Puzzle 51 - Budget versus actual

    Pages 208-211

  54. Book chapterAbstract only

    Puzzle 52 - Personnel problem

    Pages 212-214

  55. Book chapterAbstract only

    Puzzle 53 - Collapsing a table by columns

    Pages 215-217

  56. Book chapterAbstract only

    Puzzle 54 - Potential duplicates

    Pages 218-220

  57. Book chapterAbstract only

    Puzzle 55 - Playing the ponies

    Pages 221-223

  58. Book chapterAbstract only

    Puzzle 56 - Hotel room numbers

    Pages 224-226

  59. Book chapterAbstract only

    Puzzle 57 - Gaps—Version one

    Pages 227-229

  60. Book chapterAbstract only

    Puzzle 58 - Gaps—Version two

    Pages 230-233

  61. Book chapterAbstract only

    Puzzle 59 - Merging time periods

    Pages 234-236

  62. Book chapterAbstract only

    Puzzle 60 - Barcodes

    Pages 237-241

  63. Book chapterAbstract only

    Puzzle 61 - Sort a string

    Pages 242-243

  64. Book chapterAbstract only

    Puzzle 62 - Report formatting

    Pages 244-253

  65. Book chapterAbstract only

    Puzzle 63 - Contiguous groupings

    Pages 254-256

  66. Book chapterAbstract only

    Puzzle 64 - Boxes

    Pages 257-260

  67. Book chapterAbstract only

    Puzzle 65 - Age ranges for products

    Pages 261-262

  68. Book chapterAbstract only

    Puzzle 66 - Sudoku

    Pages 263-266

  69. Book chapterAbstract only

    Puzzle 67 - Stable marriages problem

    Pages 267-279

  70. Book chapterAbstract only

    Puzzle 68 - Catching the next bus

    Pages 280-282

  71. Book chapterAbstract only

    Puzzle 69 - Lifo-fifo inventory

    Pages 283-291

  72. Book chapterAbstract only

    Puzzle 70 - Stock trends

    Pages 292-296

  73. Book chapterAbstract only

    Puzzle 71 - Calculations

    Pages 297-299

  74. Book chapterAbstract only

    Puzzle 72 - Scheduling service calls

    Pages 300-303

  75. Book chapterAbstract only

    Puzzli 73 - A little data scrubbing

    Pages 304-305

  76. Book chapterAbstract only

    Puzzle 74 - Derived tables or not?

    Pages 306-308

  77. Book chapterAbstract only

    Puzzle 75 - Finding a pub

    Pages 309-311

  78. Book chapterNo access

    Index

    Pages 313-325

  79. Book chapterNo access

    About the author

    Page 327

About the book

Description

Joe Celko's SQL Puzzles and Answers, Second Edition, challenges you with his trickiest puzzles and then helps solve them with a variety of solutions and explanations.

Author Joe Celko 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 also help develop the mindset needed to solve the many difficult SQL puzzles you face every day. This updated edition features many new puzzles; dozens of new solutions to puzzles; and new chapters on temporal query puzzles and common misconceptions about SQL and RDBMS that leads to problems.

This book is recommended for database programmers with a good knowledge of SQL.

Joe Celko's SQL Puzzles and Answers, Second Edition, challenges you with his trickiest puzzles and then helps solve them with a variety of solutions and explanations.

Author Joe Celko 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 also help develop the mindset needed to solve the many difficult SQL puzzles you face every day. This updated edition features many new puzzles; dozens of new solutions to puzzles; and new chapters on temporal query puzzles and common misconceptions about SQL and RDBMS that leads to problems.

This book is recommended for database programmers with a good knowledge of SQL.

Key Features

  • A great collection of tricky SQL puzzles with a variety of solutions and explanations
  • Uses the proven format of puzzles and solutions to provide a user-friendly, practical look into SQL programming problems - many of which will help users solve their own problems
  • New edition features: Many new puzzles added!, Dozens of new solutions to puzzles, and using features in SQL-99, Code is edited to conform to SQL STYLE rules, New chapter on temporal query puzzles, New chapter on common misconceptions about SQL and RDBMS that leads to problems
  • A great collection of tricky SQL puzzles with a variety of solutions and explanations
  • Uses the proven format of puzzles and solutions to provide a user-friendly, practical look into SQL programming problems - many of which will help users solve their own problems
  • New edition features: Many new puzzles added!, Dozens of new solutions to puzzles, and using features in SQL-99, Code is edited to conform to SQL STYLE rules, New chapter on temporal query puzzles, New chapter on common misconceptions about SQL and RDBMS that leads to problems

Details

ISBN

978-0-12-373596-6

Language

English

Published

2006

Copyright

Copyright © 2006 Elsevier Inc. All rights reserved

Imprint

Morgan Kaufmann

Authors

Joe Celko