ソースコード
SELECT 
    A.ITEM_CODE AS ITEM_A,
    B.ITEM_CODE AS ITEM_B,
    ROUND((COUNT(*) * 100.0) / (SELECT COUNT(DISTINCT MEMBER_CODE) FROM PURCHASE_HISTORY), 6) AS SUPPORT,
    ROUND((COUNT(*) * 100.0) / (SELECT COUNT(DISTINCT MEMBER_CODE) FROM PURCHASE_HISTORY AS ph2 WHERE ph2.ITEM_CODE = A.ITEM_CODE), 6) AS CONFIDENCE,
    ROUND(((COUNT(*) * 1.0) / (SELECT COUNT(*) FROM PURCHASE_HISTORY AS ph2 WHERE ph2.ITEM_CODE = A.ITEM_CODE)) / ((SELECT COUNT(*) FROM PURCHASE_HISTORY AS ph2 WHERE ph2.ITEM_CODE = B.ITEM_CODE) / (SELECT COUNT(DISTINCT MEMBER_CODE) FROM PURCHASE_HISTORY)), 6) AS LIFT
FROM 
    PURCHASE_HISTORY AS A
JOIN 
    PURCHASE_HISTORY AS B ON A.MEMBER_CODE = B.MEMBER_CODE AND A.ITEM_CODE < B.ITEM_CODE
GROUP BY 
    A.ITEM_CODE, B.ITEM_CODE
ORDER BY 
    LIFT DESC, SUPPORT DESC, CONFIDENCE DESC, ITEM_A DESC;
提出情報
提出日時2024/03/20 21:03:24
コンテスト第11回 SQLコンテスト
問題アソシエーション分析
受験者Ryo
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量85 MB
メッセージ
テストケース(通過数/総数)
0/3
状態
メモリ使用量
データパターン1
WA
84 MB
データパターン2
WA
84 MB
データパターン3
WA
85 MB