-- 创建学习报告表
CREATE TABLE study_report (
    report_id BIGINT PRIMARY KEY AUTO_INCREMENT COMMENT '报告ID',
    goal_id BIGINT NOT NULL COMMENT '目标ID',
    user_id BIGINT NOT NULL COMMENT '用户ID',
    generate_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '生成时间',
    accuracy DECIMAL(5,2) COMMENT '正确率',
    total_duration INT COMMENT '总共用时(秒)',
    knowledge_analysis JSON COMMENT '知识点分析',
    difficulty_analysis JSON COMMENT '难度分析',
    FOREIGN KEY (goal_id) REFERENCES goals(goal_id),
    FOREIGN KEY (user_id) REFERENCES user_info(user_id)
) COMMENT='学习报告表';