Treasure Data - データ分析をクラウドで、シンプルに。 - Treasure Data はじめに 前回の「頭の体操編」では,数字やトランプの組み合わせの抽出をSQLで実践してみました。本題に入る前に,今回はこの「組み合わせ」が引き起こすバスケット分析の本質的な問題の1つ:「計算量の問題」について説明し,分析の際にはいつもこの問題を心にとめておいてもらえる事を目的としています。 SQLで頭の体操 〜組み合わせの計算〜(続) 前回に引き続いてもう2つだけ頭の体操をしましょう。下のトランプテーブルを使います。 課題9:53枚のトランプのペアの組み合わせを全て考える。 今回の課題はシンプルに,53種のカードのペアが取り得る組み合わせ(順序は別とします)を考えてみましょう。クエリは課題1と同じです。 さて,このクエリで全部で何種類のペアが生成されたのでしょうか? 答えは 2,809 通