-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_missing_answers.sql
More file actions
82 lines (74 loc) · 2.28 KB
/
Copy pathcheck_missing_answers.sql
File metadata and controls
82 lines (74 loc) · 2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
-- 查询AI内置题库中缺少最佳答案的问题
WITH ai_bank_questions AS (
SELECT
jsonb_array_elements_text(
CASE
WHEN jsonb_typeof("simulatedInterview"->'architectureDesign') = 'array'
THEN "simulatedInterview"->'architectureDesign'
ELSE '[]'::jsonb
END
) as question_content,
'architectureDesign' as category
FROM "ResumeAIProfile"
WHERE "simulatedInterview" IS NOT NULL
UNION ALL
SELECT
jsonb_array_elements_text(
CASE
WHEN jsonb_typeof("simulatedInterview"->'techDepth'->'Kubernetes') = 'array'
THEN "simulatedInterview"->'techDepth'->'Kubernetes'
ELSE '[]'::jsonb
END
) as question_content,
'techDepth' as category
FROM "ResumeAIProfile"
WHERE "simulatedInterview" IS NOT NULL
UNION ALL
SELECT
jsonb_array_elements_text(
CASE
WHEN jsonb_typeof("simulatedInterview"->'techDepth'->'Flink') = 'array'
THEN "simulatedInterview"->'techDepth'->'Flink'
ELSE '[]'::jsonb
END
) as question_content,
'techDepth' as category
FROM "ResumeAIProfile"
WHERE "simulatedInterview" IS NOT NULL
UNION ALL
SELECT
jsonb_array_elements_text(
CASE
WHEN jsonb_typeof("simulatedInterview"->'techDepth'->'TensorFlow') = 'array'
THEN "simulatedInterview"->'techDepth'->'TensorFlow'
ELSE '[]'::jsonb
END
) as question_content,
'techDepth' as category
FROM "ResumeAIProfile"
WHERE "simulatedInterview" IS NOT NULL
UNION ALL
SELECT
jsonb_array_elements_text(
CASE
WHEN jsonb_typeof("simulatedInterview"->'leadership') = 'array'
THEN "simulatedInterview"->'leadership'
ELSE '[]'::jsonb
END
) as question_content,
'leadership' as category
FROM "ResumeAIProfile"
WHERE "simulatedInterview" IS NOT NULL
)
SELECT
abq.question_content,
abq.category,
CASE
WHEN q.id IS NULL THEN '❌ 无最佳答案'
WHEN q."modelAnswer" IS NULL THEN '❌ 无最佳答案'
ELSE '✅ 有最佳答案'
END as answer_status
FROM ai_bank_questions abq
LEFT JOIN "Question" q ON q.content = abq.question_content AND q."modelAnswer" IS NOT NULL
WHERE q.id IS NULL OR q."modelAnswer" IS NULL
ORDER BY abq.category, abq.question_content;