peixue-dev/Archive/[一次性]检查考核题目数据-2026-02-26.sql

40 lines
801 B
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 检查考核题目数据
-- 1. 检查 exam_question 表是否存在
SHOW TABLES LIKE 'exam_question';
-- 2. 检查表结构
DESC exam_question;
-- 3. 检查题目数量
SELECT
level,
COUNT(*) as question_count,
SUM(CASE WHEN deleted = 0 THEN 1 ELSE 0 END) as active_count
FROM exam_question
GROUP BY level;
-- 4. 查看所有题目
SELECT
id,
level,
question_type,
LEFT(question_content, 50) as question_preview,
correct_answer,
score,
deleted
FROM exam_question
ORDER BY level, id;
-- 5. 检查是否有足够的题目每个等级至少需要10题
SELECT
level,
COUNT(*) as total,
CASE
WHEN COUNT(*) >= 10 THEN '✓ 足够'
ELSE '✗ 不足'
END as status
FROM exam_question
WHERE deleted = 0
GROUP BY level;