peixue-dev/Archive/[一次性]检查teacher表数据-2026-02-01.sql

42 lines
844 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.

-- 检查teacher表数据
-- 用于验证是否有教师数据可以显示
-- 查看教师总数
SELECT COUNT(*) as teacher_count FROM teacher;
-- 查看已审核的教师数量
SELECT COUNT(*) as approved_teacher_count
FROM teacher
WHERE audit_status = 1;
-- 查看教师列表前10条
SELECT
id,
name,
real_name,
teacher_name,
phone,
audit_status,
status,
teacher_level,
subject,
area,
grade,
create_time
FROM teacher
ORDER BY create_time DESC
LIMIT 10;
-- 查看各审核状态的教师数量
SELECT
audit_status,
COUNT(*) as count,
CASE
WHEN audit_status = 0 THEN '待审核'
WHEN audit_status = 1 THEN '已通过'
WHEN audit_status = 2 THEN '已拒绝'
ELSE '未知状态'
END as status_name
FROM teacher
GROUP BY audit_status;