package com.example.myapplication;

import android.app.Application;
import com.example.myapplication.repository.DatabaseManager;

public class MyNoteApp extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        try {
            DatabaseManager.init(this);
        } catch (Exception e) {
            android.util.Log.e("MyNoteApp", "Database init failed", e);
        }

        try {
            android.database.sqlite.SQLiteDatabase db = com.example.myapplication.repository.DatabaseManager.getDb();
            if (db != null) {
                db.beginTransaction();
                try {
                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (1, '编译原理', 'CS-301', '编译原理是计算机科学中的重要基础课程，主要介绍编译器的设计与实现技术。')");

                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (1, 1, '第一章 编译器概述', 'CS-301-01', '介绍编译器的基本概念、结构和工作原理', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (2, 1, '第二章 词法分析', 'CS-301-02', '讲解词法分析的基本原理和实现方法', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (3, 1, '第三章 语法分析', 'CS-301-03', '深入探讨语法分析的理论和实践', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (4, 1, '第四章 语法制导翻译', 'CS-301-04', '介绍语法制导翻译的基本概念和方法', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (5, 1, '第五章 类型检查', 'CS-301-05', '讲解类型检查的原理和实现', 5)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (6, 1, '第六章 运行时环境', 'CS-301-06', '分析程序运行时的存储管理机制', 6)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (7, 1, '第七章 中间代码生成', 'CS-301-07', '介绍中间代码的生成方法和技术', 7)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (8, 1, '第八章 代码生成', 'CS-301-08', '讲解目标代码生成的基本原理和算法', 8)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (9, 1, '第九章 代码优化', 'CS-301-09', '深入探讨代码优化的各种技术', 9)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (10, 1, '第十章 数据流分析', 'CS-301-10', '介绍数据流分析的理论基础和算法', 10)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (11, 1, '第十一章 循环优化', 'CS-301-11', '专门讨论循环结构的优化技术', 11)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (12, 1, '第十二章 过程间分析', 'CS-301-12', '探讨跨越过程边界的程序分析技术', 12)");

                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10001, 1, '大三')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (2, '数据结构', 'CS-303', '数据结构是计算机科学的核心课程，研究数据的组织、存储和管理方法。')");

                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (13, 2, '第一章 绪论', 'CS-303-01', '介绍数据结构的基本概念和算法分析方法', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (14, 2, '第二章 线性表', 'CS-303-02', '讲解线性表的顺序存储和链式存储实现', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (15, 2, '第三章 栈和队列', 'CS-303-03', '分析栈和队列的特性及其应用', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (16, 2, '第四章 串', 'CS-303-04', '研究字符串的存储结构和模式匹配算法', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (17, 2, '第五章 树与二叉树', 'CS-303-05', '介绍树的基本概念和二叉树的性质与操作', 5)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (18, 2, '第六章 树与二叉树的应用', 'CS-303-06', '探讨树结构在实际问题中的应用', 6)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (19, 2, '第七章 图', 'CS-303-07', '讲解图的基本概念和存储表示', 7)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (20, 2, '第八章 图的应用', 'CS-303-08', '分析图在路径查找和网络优化中的应用', 8)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (21, 2, '第九章 查找', 'CS-303-09', '研究各种查找算法的实现和性能', 9)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (22, 2, '第十章 排序', 'CS-303-10', '讲解各种排序算法的原理和实现', 10)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (23, 2, '第十一章 高级数据结构', 'CS-303-11', '介绍高级数据结构及其应用场景', 11)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (24, 2, '第十二章 算法设计与分析', 'CS-303-12', '探讨算法设计策略和复杂度分析', 12)");

                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10001, 2, '大三')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (3, '计算机网络', 'CS-304', '计算机网络是研究计算机之间如何相互连接和通信的学科。')");

                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (25, 3, '第一章 计算机网络概述', 'CS-304-01', '介绍计算机网络的基本概念和发展历程', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (26, 3, '第二章 网络体系结构', 'CS-304-02', '讲解网络分层体系结构和各种模型', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (27, 3, '第三章 物理层', 'CS-304-03', '分析物理层的数据传输原理和技术', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (28, 3, '第四章 数据链路层', 'CS-304-04', '研究数据链路层的帧传输和差错控制', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (29, 3, '第五章 局域网', 'CS-304-05', '介绍局域网技术和以太网协议', 5)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (30, 3, '第六章 网络层', 'CS-304-06', '深入分析网络层的路由和寻址机制', 6)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (31, 3, '第七章 传输层', 'CS-304-07', '研究传输层的端到端通信服务', 7)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (32, 3, '第八章 应用层', 'CS-304-08', '介绍常见的网络应用协议和服务', 8)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (33, 3, '第九章 网络安全', 'CS-304-09', '分析网络安全威胁和防护措施', 9)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (34, 3, '第十章 网络管理', 'CS-304-10', '讨论网络管理的方法和技术', 10)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (35, 3, '第十一章 无线网络', 'CS-304-11', '介绍无线通信技术和移动网络', 11)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (36, 3, '第十二章 网络新技术', 'CS-304-12', '探讨新兴网络技术的发展趋势和应用', 12)");

                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10001, 3, '大三')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (4, '操作系统', 'CS-302', '操作系统是计算机系统的核心软件，负责管理硬件资源和提供用户接口。')");

                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (37, 4, '第一章 操作系统概述', 'CS-302-01', '介绍操作系统的基本概念、功能和分类', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (38, 4, '第二章 进程管理', 'CS-302-02', '讲解进程的基本概念和管理机制', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (39, 4, '第三章 线程管理', 'CS-302-03', '深入探讨线程的概念和管理方法', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (40, 4, '第四章 进程同步', 'CS-302-04', '分析进程间的同步与互斥问题', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (41, 4, '第五章 内存管理', 'CS-302-05', '讲解内存管理的基本原理和技术', 5)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (42, 4, '第六章 文件系统', 'CS-302-06', '介绍文件系统的组织和管理', 6)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (43, 4, '第七章 I/O系统', 'CS-302-07', '分析输入输出系统的原理和管理', 7)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (44, 4, '第八章 虚拟内存', 'CS-302-08', '深入探讨虚拟内存的实现机制', 8)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (45, 4, '第九章 系统保护与安全', 'CS-302-09', '讨论操作系统的安全保护和访问控制', 9)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (46, 4, '第十章 分布式系统', 'CS-302-10', '介绍分布式操作系统的基本概念和机制', 10)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (47, 4, '第十一章 实时系统', 'CS-302-11', '分析实时操作系统的特点和要求', 11)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (48, 4, '第十二章 Linux内核分析', 'CS-302-12', '深入分析Linux操作系统的内核实现', 12)");

                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10001, 4, '大三')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (5, '机器人学导论（第4版）', 'RBT-INTRO-4e', '机器人学导论课程，涵盖机器人运动学、动力学、控制等核心内容')");

                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (49, 5, '第1章 概述', 'RBT-1', '机器人学基本概念和机械臂几何结构介绍', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (50, 5, '第2章 空间描述和变换', 'RBT-2', '位置、姿态、坐标系变换和欧拉角等数学基础', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (51, 5, '第3章 操作臂运动学', 'RBT-3', '连杆、关节描述和D-H参数法建立运动学方程', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (52, 5, '第4章 操作臂逆运动学', 'RBT-4', '逆运动学的可解性分析和解法研究', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (53, 5, '第5章 速度和静力', 'RBT-5', '线速度、角速度表示和雅可比矩阵分析', 5)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (54, 5, '第6章 操作臂动力学', 'RBT-6', '机器人动力学建模和牛顿-欧拉、拉格朗日方法', 6)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (55, 5, '第7章 轨迹生成', 'RBT-7', '关节空间和笛卡尔空间的轨迹规划方法', 7)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (56, 5, '第8章 操作臂的机械设计', 'RBT-8', '机器人机械结构设计原理', 8)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (57, 5, '第9章 操作臂的线性控制', 'RBT-9', '机器人线性控制系统设计和PID控制', 9)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (58, 5, '第10章 操作臂的非线性控制', 'RBT-10', '机器人非线性控制方法', 10)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (59, 5, '第11章 操作臂的力控制', 'RBT-11', '机器人柔顺控制和力/位混合控制', 11)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (60, 5, '第12章 机器人编程语言与系统', 'RBT-12', '机器人编程语言和系统介绍', 12)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (61, 5, '第13章 离线编程系统', 'RBT-13', '机器人离线仿真和编程技术', 13)");

                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10001, 5, '大三')");

                    // 高等数学
                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (6, '高等数学', 'MATH-101', '涵盖微积分、线性代数、概率论与数理统计等基础数学内容')");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (62, 6, '微积分基础', 'MATH-101-01', '极限、导数与积分的基本概念与运算', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (63, 6, '多元微积分', 'MATH-101-02', '多元函数微分与重积分、方向导数与梯度', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (64, 6, '级数', 'MATH-101-03', '数项级数与函数项级数、收敛判别法', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (65, 6, '向量与空间解析几何', 'MATH-101-04', '向量运算、空间直线与平面、二次曲面', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (66, 6, '线性代数基础', 'MATH-101-05', '线性方程组与向量空间、线性变换', 5)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (67, 6, '行列式与矩阵', 'MATH-101-06', '行列式性质、矩阵运算与初等变换', 6)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (68, 6, '特征值与特征向量', 'MATH-101-07', '特征值问题、相似对角化与主成分', 7)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (69, 6, '概率论', 'MATH-101-08', '概率模型、条件概率与全概率公式', 8)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (70, 6, '随机变量与分布', 'MATH-101-09', '常见分布、期望方差与矩母函数', 9)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (71, 6, '数理统计', 'MATH-101-10', '估计、区间估计与检验的基本方法', 10)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (72, 6, '假设检验与方差分析', 'MATH-101-11', '假设检验框架、t检验与ANOVA', 11)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (73, 6, '数值方法初步', 'MATH-101-12', '插值、数值积分与迭代解方程', 12)");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10001, 6, '大一')");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10044, 6, '大一')");

                    // 大学英语
                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (7, '大学英语', 'ENG-101', '大学英语综合教程，涵盖词汇、语法、阅读、写作、听说等能力提升')");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (74, 7, '词汇与短语', 'ENG-101-01', '核心词汇与常用短语积累', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (75, 7, '语法与句法', 'ENG-101-02', '时态、语态、从句与复杂句式', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (76, 7, '阅读理解', 'ENG-101-03', '篇章结构与主旨细节理解', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (77, 7, '写作训练', 'ENG-101-04', '段落与文章写作、论证与修辞', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (78, 7, '听力训练', 'ENG-101-05', '学术与生活场景听力理解', 5)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (79, 7, '口语交流', 'ENG-101-06', '发音与口语表达、讨论与演讲', 6)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (80, 7, '翻译与改写', 'ENG-101-07', '汉英/英汉翻译技巧与改写', 7)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (81, 7, '英美文化', 'ENG-101-08', '跨文化理解与背景知识', 8)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (82, 7, '学术英语', 'ENG-101-09', '学术阅读与写作、术语与体裁', 9)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (83, 7, '综合复习', 'ENG-101-10', '综合能力提升与期末复习', 10)");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10001, 7, '大一')");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10044, 7, '大一')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (100, '毛泽东思想和中国特色社会主义理论体系概论', 'POL-001', '系统阐释中国化马克思主义的理论与实践')");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (84, 100, '第一章 绪论', 'POL-001-01', '课程导论与学习要求', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (85, 100, '第二章 新民主主义革命理论', 'POL-001-02', '中国革命道路与理论', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (86, 100, '第三章 社会主义改造理论', 'POL-001-03', '社会主义改造的理论与实践', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (87, 100, '第四章 社会主义建设探索', 'POL-001-04', '社会主义建设道路探索', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (88, 100, '第五章 改革开放与中国特色社会主义', 'POL-001-05', '改革开放历史进程与理论成果', 5)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (89, 100, '第六章 总体布局与战略布局', 'POL-001-06', '五位一体与四个全面', 6)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (90, 100, '第七章 党的领导与全面从严治党', 'POL-001-07', '党的建设与治理能力现代化', 7)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (91, 100, '第八章 国家治理现代化', 'POL-001-08', '国家治理体系与治理能力现代化', 8)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (92, 100, '第九章 民生与社会建设', 'POL-001-09', '民生改善与社会建设', 9)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (93, 100, '第十章 青年责任与时代使命', 'POL-001-10', '新时代青年的使命担当', 10)");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10044, 100, '大一')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (101, '思想道德与法治', 'POL-002', '提升思想道德修养与法治素养')");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (94, 101, '第一章 道德与人生', 'POL-002-01', '道德的本质与价值', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (95, 101, '第二章 社会主义核心价值观', 'POL-002-02', '核心价值观的培育与践行', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (96, 101, '第三章 法治与法治思维', 'POL-002-03', '法治理念与法治思维', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (97, 101, '第四章 宪法与宪法权利', 'POL-002-04', '宪法基本原则与权利保障', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (98, 101, '第五章 民法典与民事权利', 'POL-002-05', '民法典体系与权利义务', 5)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (99, 101, '第六章 刑法概述', 'POL-002-06', '刑法基本原理与犯罪构成', 6)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (100, 101, '第七章 行政法与行政救济', 'POL-002-07', '行政行为与救济途径', 7)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (101, 101, '第八章 涉网法治与合规', 'POL-002-08', '网络安全法治与合规要求', 8)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (102, 101, '第九章 大学生法治素养', 'POL-002-09', '校园场景中的法治意识', 9)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (103, 101, '第十章 职业伦理与社会责任', 'POL-002-10', '职业道德与社会责任', 10)");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10044, 101, '大一')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (102, '马克思主义基本原理', 'POL-003', '马克思主义哲学、政治经济学与科学社会主义基本原理')");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (104, 102, '第一章 哲学基本问题', 'POL-003-01', '物质与意识的关系', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (105, 102, '第二章 辩证唯物主义', 'POL-003-02', '世界的物质统一性与发展规律', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (106, 102, '第三章 历史唯物主义', 'POL-003-03', '社会历史发展的普遍规律', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (107, 102, '第四章 政治经济学原理', 'POL-003-04', '剩余价值与资本运行', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (108, 102, '第五章 科学社会主义', 'POL-003-05', '社会主义产生、发展与实践', 5)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (109, 102, '第六章 马克思主义中国化', 'POL-003-06', '中国化时代化的理论成果', 6)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (110, 102, '第七章 价值观与人生观', 'POL-003-07', '价值选择与人生道路', 7)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (111, 102, '第八章 社会发展与现代化', 'POL-003-08', '社会现代化与中国式现代化', 8)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (112, 102, '第九章 实践与认识', 'POL-003-09', '实践与认识的辩证统一', 9)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (113, 102, '第十章 理论与方法论', 'POL-003-10', '基本立场、观点与方法', 10)");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10044, 102, '大一')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (103, '中国近现代史纲要', 'POL-004', '中国近现代史进程与基本规律')");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (114, 103, '第一章 近代中国的沦陷与抗争', 'POL-004-01', '近代中国国情与反侵略斗争', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (115, 103, '第二章 辛亥革命与共和探索', 'POL-004-02', '辛亥革命与民国初期探索', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (116, 103, '第三章 中国共产党成立与新民主主义革命', 'POL-004-03', '新民主主义革命的开展', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (117, 103, '第四章 抗日战争与民族解放', 'POL-004-04', '全民族抗战与胜利', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (118, 103, '第五章 解放战争与新中国成立', 'POL-004-05', '全国解放与新中国成立', 5)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (119, 103, '第六章 社会主义改造与建设', 'POL-004-06', '社会主义改造与早期建设', 6)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (120, 103, '第七章 改革开放与现代化建设', 'POL-004-07', '改革开放与现代化进程', 7)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (121, 103, '第八章 中国特色社会主义新时代', 'POL-004-08', '新时代的历史方位与任务', 8)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (122, 103, '第九章 民族复兴与中国梦', 'POL-004-09', '民族复兴的历史逻辑', 9)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (123, 103, '第十章 历史人物与史料研读', 'POL-004-10', '重要历史人物与史料研读', 10)");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10044, 103, '大一')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (104, '大学体育', 'PE-101', '增强体质与掌握基本运动技能')");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (124, 104, '第一章 体育与健康概论', 'PE-101-01', '体育与健康的关系', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (125, 104, '第二章 田径基础', 'PE-101-02', '跑、跳、投的基础技能', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (126, 104, '第三章 球类运动基础', 'PE-101-03', '篮球、足球、排球基础', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (127, 104, '第四章 健身与体能训练', 'PE-101-04', '力量与心肺耐力训练', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (128, 104, '第五章 安全与运动损伤防护', 'PE-101-05', '运动损伤预防与处理', 5)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (129, 104, '第六章 体质评价与管理', 'PE-101-06', '体测与健康管理', 6)");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10044, 104, '大一')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (105, '军事理论', 'MIL-101', '国防与安全、军事制度与科技')");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (130, 105, '第一章 国防概述', 'MIL-101-01', '国家安全与国防建设', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (131, 105, '第二章 现代战争形态', 'MIL-101-02', '信息化战争与联合作战', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (132, 105, '第三章 我国军事制度', 'MIL-101-03', '兵役制度与国防动员', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (133, 105, '第四章 军事科技与装备', 'MIL-101-04', '军事科技发展与武器装备', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (134, 105, '第五章 国家安全与总体安全观', 'MIL-101-05', '总体国家安全观', 5)");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10044, 105, '大一')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (106, '微积分', 'MATH-201', '函数、极限、导数与积分的系统学习')");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (135, 106, '第一章 函数与极限', 'MATH-201-01', '函数与极限的基础', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (136, 106, '第二章 导数与微分', 'MATH-201-02', '导数与微分运算', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (137, 106, '第三章 不定积分', 'MATH-201-03', '积分基本方法', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (138, 106, '第四章 定积分与应用', 'MATH-201-04', '定积分性质与应用', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (139, 106, '第五章 多元函数微分', 'MATH-201-05', '偏导与梯度', 5)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (140, 106, '第六章 重积分与曲线曲面积分', 'MATH-201-06', '重积分与曲线曲面积分', 6)");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10001, 106, '大一')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (107, '线性代数', 'MATH-202', '矩阵、向量空间与线性变换')");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (141, 107, '第一章 行列式与矩阵', 'MATH-202-01', '行列式与矩阵运算', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (142, 107, '第二章 向量与向量空间', 'MATH-202-02', '向量空间与线性相关', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (143, 107, '第三章 线性方程组', 'MATH-202-03', '线性方程组解法', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (144, 107, '第四章 特征值与对角化', 'MATH-202-04', '特征值与相似对角化', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (145, 107, '第五章 正交与最小二乘', 'MATH-202-05', '内积空间与最小二乘', 5)");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10001, 107, '大一')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (108, '概率论与数理统计', 'MATH-203', '随机变量与统计推断')");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (146, 108, '第一章 概率与条件概率', 'MATH-203-01', '概率基础与条件概率', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (147, 108, '第二章 随机变量与分布', 'MATH-203-02', '常见分布与性质', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (148, 108, '第三章 数字特征与联合分布', 'MATH-203-03', '期望方差协方差', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (149, 108, '第四章 大数定律与中心极限定理', 'MATH-203-04', '极限定理', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (150, 108, '第五章 参数估计与假设检验', 'MATH-203-05', '点估计与检验', 5)");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10001, 108, '大一')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (109, '程序设计基础', 'CS-101', '编程基础语法与问题求解')");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (151, 109, '第一章 计算机与程序', 'CS-101-01', '编程概念与开发环境', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (152, 109, '第二章 基本数据类型与运算', 'CS-101-02', '数据类型与运算', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (153, 109, '第三章 选择与循环', 'CS-101-03', '控制结构', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (154, 109, '第四章 函数与递归', 'CS-101-04', '函数封装与递归', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (155, 109, '第五章 数组与字符串', 'CS-101-05', '顺序数据结构', 5)");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10001, 109, '大一')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (110, '面向对象程序设计', 'CS-102', '类、对象与抽象机制')");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (156, 110, '第一章 面向对象概述', 'CS-102-01', 'OO思想与基本概念', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (157, 110, '第二章 类与对象', 'CS-102-02', '封装与构造', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (158, 110, '第三章 继承与多态', 'CS-102-03', '继承层次与动态绑定', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (159, 110, '第四章 接口与泛型', 'CS-102-04', '接口抽象与泛型编程', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (160, 110, '第五章 异常与IO', 'CS-102-05', '异常处理与文件IO', 5)");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10001, 110, '大二')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (111, '数字逻辑电路', 'EE-201', '逻辑代数与组合时序电路')");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (161, 111, '第一章 逻辑代数基础', 'EE-201-01', '布尔代数与逻辑化简', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (162, 111, '第二章 组合逻辑电路', 'EE-201-02', '组合电路设计', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (163, 111, '第三章 时序逻辑电路', 'EE-201-03', '触发器与时序分析', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (164, 111, '第四章 可编程逻辑器件', 'EE-201-04', 'PAL、FPGA基础', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10001, 111, '大二')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (112, '离散数学', 'CS-201', '集合、图与形式逻辑')");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (165, 112, '第一章 集合与关系', 'CS-201-01', '集合、关系与函数', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (166, 112, '第二章 逻辑与证明', 'CS-201-02', '命题逻辑与证明方法', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (167, 112, '第三章 图论基础', 'CS-201-03', '图与树结构', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (168, 112, '第四章 组合数学', 'CS-201-04', '计数原理与递推', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10001, 112, '大二')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (113, '计算机组成原理', 'CS-202', '指令系统、存储层次与CPU')");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (169, 113, '第一章 计算机系统概述', 'CS-202-01', '计算机系统结构', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (170, 113, '第二章 数据表示与运算', 'CS-202-02', '编码与算术运算', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (171, 113, '第三章 存储系统', 'CS-202-03', '主存与Cache', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (172, 113, '第四章 指令系统', 'CS-202-04', '指令格式与寻址', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10001, 113, '大二')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (114, '汇编语言', 'CS-203', '汇编语法与底层编程')");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (173, 114, '第一章 机器与汇编', 'CS-203-01', '机器指令与汇编基础', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (174, 114, '第二章 寄存器与指令', 'CS-203-02', '寄存器与常用指令', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (175, 114, '第三章 子程序与调用', 'CS-203-03', '过程调用与栈', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10001, 114, '大二')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (115, '数据库', 'CS-305', '关系模型、SQL与事务')");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (176, 115, '第一章 关系数据库概述', 'CS-305-01', '数据模型与规范化', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (177, 115, '第二章 SQL语言', 'CS-305-02', '查询、更新与视图', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (178, 115, '第三章 事务与并发控制', 'CS-305-03', '事务隔离与锁', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (179, 115, '第四章 索引与优化', 'CS-305-04', '索引结构与优化', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10001, 115, '大二')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (116, '机器学习', 'AI-301', '监督学习、无监督与优化')");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (180, 116, '第一章 机器学习概述', 'AI-301-01', '基本概念与术语', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (181, 116, '第二章 线性模型', 'AI-301-02', '回归与分类', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (182, 116, '第三章 树模型与集成', 'AI-301-03', '决策树与Boosting', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (183, 116, '第四章 聚类与降维', 'AI-301-04', 'KMeans与PCA', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10001, 116, '大三')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (117, '深度学习', 'AI-302', '神经网络、卷积与序列模型')");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (184, 117, '第一章 神经网络基础', 'AI-302-01', '前馈网络与反向传播', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (185, 117, '第二章 卷积神经网络', 'AI-302-02', 'CNN结构与应用', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (186, 117, '第三章 循环与序列模型', 'AI-302-03', 'RNN、LSTM、Transformer', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (187, 117, '第四章 训练与正则化', 'AI-302-04', '优化与正则化策略', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10001, 117, '大三')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (118, '自然语言处理', 'AI-303', '文本表示、序列建模与生成')");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (188, 118, '第一章 文本预处理与表示', 'AI-303-01', '分词、词向量与编码', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (189, 118, '第二章 语言模型', 'AI-303-02', '统计与神经语言模型', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (190, 118, '第三章 序列标注', 'AI-303-03', '标注与序列任务', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (191, 118, '第四章 文本生成与理解', 'AI-303-04', '生成模型与理解', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10001, 118, '大三')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (119, '计算机视觉', 'AI-304', '图像处理、特征与检测识别')");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (192, 119, '第一章 图像基础', 'AI-304-01', '图像采集与颜色空间', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (193, 119, '第二章 图像滤波与增强', 'AI-304-02', '空间与频域处理', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (194, 119, '第三章 特征提取', 'AI-304-03', '边缘、角点与局部特征', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (195, 119, '第四章 目标检测与识别', 'AI-304-04', '检测识别方法', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10001, 119, '大三')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (120, '网络安全', 'SECU-301', '攻击与防御、漏洞与加固')");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (196, 120, '第一章 安全概述', 'SECU-301-01', '威胁模型与安全目标', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (197, 120, '第二章 密码学基础', 'SECU-301-02', '对称、非对称与哈希', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (198, 120, '第三章 漏洞与利用', 'SECU-301-03', '常见漏洞类型与利用', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (199, 120, '第四章 网络攻防', 'SECU-301-04', '渗透与防御技术', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10001, 120, '大三')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (121, '密码学', 'CRYPTO-301', '现代密码体制与协议')");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (200, 121, '第一章 古典密码与现代密码', 'CRYPTO-301-01', '密码发展与概述', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (201, 121, '第二章 对称加密', 'CRYPTO-301-02', '分组与流密码', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (202, 121, '第三章 公钥密码', 'CRYPTO-301-03', 'RSA、ECC等', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (203, 121, '第四章 消息认证与签名', 'CRYPTO-301-04', 'MAC与签名', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10001, 121, '大三')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (122, '软件工程', 'SE-301', '需求、设计、实现与维护')");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (204, 122, '第一章 软件工程概述', 'SE-301-01', '软件过程与方法', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (205, 122, '第二章 需求工程', 'SE-301-02', '需求获取与分析', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (206, 122, '第三章 架构设计', 'SE-301-03', '架构风格与模式', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (207, 122, '第四章 测试与质量保证', 'SE-301-04', '测试策略与质量', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10001, 122, '大二')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (123, '计算机图形学', 'CG-301', '几何、渲染与图形系统')");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (208, 123, '第一章 图形学概述', 'CG-301-01', '渲染管线与基础', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (209, 123, '第二章 几何与变换', 'CG-301-02', '矩阵变换与投影', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (210, 123, '第三章 光照与着色', 'CG-301-03', '光照模型与着色', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (211, 123, '第四章 曲线与曲面', 'CG-301-04', 'Bezier与B样条', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10001, 123, '大三')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (124, '数字图像处理', 'DIP-301', '图像采集、增强与分析')");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (212, 124, '第一章 图像采集与表示', 'DIP-301-01', '采集与表示基础', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (213, 124, '第二章 图像增强', 'DIP-301-02', '直方图与滤波增强', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (214, 124, '第三章 图像分割', 'DIP-301-03', '阈值、边缘与区域方法', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (215, 124, '第四章 图像特征与理解', 'DIP-301-04', '特征提取与理解', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10001, 124, '大三')");

                    db.execSQL("INSERT OR IGNORE INTO T_Subject (id, name, code, description) VALUES (125, '嵌入式系统', 'EE-301', '嵌入式硬件、RTOS与外设')");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (216, 125, '第一章 嵌入式概述', 'EE-301-01', '嵌入式系统组成', 1)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (217, 125, '第二章 处理器与存储', 'EE-301-02', '处理器架构与存储', 2)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (218, 125, '第三章 RTOS基础', 'EE-301-03', '任务、调度与同步', 3)");
                    db.execSQL("INSERT OR IGNORE INTO T_Chapter (id, subject_id, name, code, description, order_num) VALUES (219, 125, '第四章 外设与驱动', 'EE-301-04', 'GPIO、串口与驱动', 4)");
                    db.execSQL("INSERT OR IGNORE INTO T_Major_Subject (major_id, subject_id, grade) VALUES (10001, 125, '大三')");

                    db.setTransactionSuccessful();
                } finally {
                        db.endTransaction();
                }
            }
        } catch (Exception e) {
            android.util.Log.e("MyNoteApp", "Seed data insert failed", e);
        }

        // 统一重复课程：将旧科目(2:数据结构,3:计算机网络,4:操作系统,6:高等数学)映射到新科目(20002,20004,20003,20013)，并删除旧记录
        try {
            android.database.sqlite.SQLiteDatabase db = com.example.myapplication.repository.DatabaseManager.getDb();
            if (db != null) {
                db.beginTransaction();
                try {
                    db.execSQL("UPDATE T_Major_Subject SET subject_id=20002 WHERE subject_id=2");
                    db.execSQL("UPDATE T_Major_Subject SET subject_id=20004 WHERE subject_id=3");
                    db.execSQL("UPDATE T_Major_Subject SET subject_id=20003 WHERE subject_id=4");
                    db.execSQL("UPDATE T_Major_Subject SET subject_id=20013 WHERE subject_id=6");

                    db.execSQL("DELETE FROM T_Chapter WHERE subject_id IN (2,3,4,6)");
                    db.execSQL("DELETE FROM T_Subject WHERE id IN (2,3,4,6)");

                    db.setTransactionSuccessful();
                } finally {
                    db.endTransaction();
                }
            }
        } catch (Exception e) {
            android.util.Log.e("MyNoteApp", "Dedup subjects failed", e);
        }
        // 移除清理白名单，允许数据库长期存储更多课程与章节

        try {
            android.database.sqlite.SQLiteDatabase db = com.example.myapplication.repository.DatabaseManager.getDb();
            if (db != null) {
                db.beginTransaction();
                try {
                    db.execSQL("UPDATE T_Chapter SET keywords='栈,队列,入栈,出栈,链表', aliases='stack,queue' WHERE id=15");
                    db.execSQL("UPDATE T_Chapter SET keywords='树,二叉树,遍历,BST', aliases='tree,binary tree' WHERE id=17");
                    db.execSQL("UPDATE T_Chapter SET keywords='内存,分页,分段,虚拟内存', aliases='memory,vm' WHERE id=41");
                    db.execSQL("UPDATE T_Chapter SET keywords='IO,设备,驱动,缓冲', aliases='io,i/o' WHERE id=43");
                    db.execSQL("UPDATE T_Chapter SET keywords='TCP,UDP,端口,连接', aliases='transport layer' WHERE id=31");
                    db.execSQL("UPDATE T_Chapter SET keywords='HTTP,DNS,SMTP,FTP', aliases='application layer' WHERE id=32");
                    db.execSQL("UPDATE T_Chapter SET keywords='D-H参数,关节,连杆,运动学', aliases='kinematics' WHERE id=51");
                    db.execSQL("UPDATE T_Chapter SET keywords='动力学,拉格朗日,牛顿-欧拉', aliases='dynamics' WHERE id=54");
                    db.setTransactionSuccessful();
                } finally {
                    db.endTransaction();
                }
            }
        } catch (Exception e) {
            android.util.Log.e("MyNoteApp", "Seed keywords update failed", e);
        }
    }
}