---
# System prepended metadata

title: database code

---

# database code


## 未完成的部分 : 補上正規化圖，舊的code在最後

## 我改過的 CODE
```clike=
START TRANSACTION;
CREATE DATABASE final_project;
USE final_project ;
SHOW TABLES ;
DROP TABLE course_field;
CREATE TABLE course_field (
   	field_no	          INTEGER NOT NULL,
   	curriculum_field	TEXT ,
	PRIMARY KEY (field_no)
);
   
INSERT INTO course_field (field_no,curriculum_field)
 VALUES ('1', '理論數學'), 
 ('2', '人工智慧'), 
 ('3', '資料科學'), 
 ('4', '多媒體'),
 ('5', '資料科學'), 
 ('6', '財務工程'), 
 ('7', '統計推論'), 
 ('8', '基礎知識'), 
 ('9', '人文思想');
   
SELECT * FROM course_field ;
/*===========================*/



/*============================*/
/* course_teacher */
DROP TABLE course_teacher;
CREATE TABLE course_teacher (
	teacher_no	INTEGER NOT NULL,
	teacher_name	varchar(20),
    PRIMARY KEY (teacher_no)
);
INSERT INTO course_teacher (teacher_no,teacher_name)
VALUES ('1','岳飛'),
 ('2','陸羽'),
 ('3','劉邦'),
 ('4','項羽'),
 ('5','孔丘'),
 ('6','莊周'),
 ('7','巴哈'),
 ('8','達文西');
 
SELECT * FROM course_teacher;

/*===========================*/
/* time_info */

#DROP TABLE time_info;

CREATE TABLE time_info (
	time_id	INTEGER,
    course_time	varchar(20),
    PRIMARY KEY (time_id)
) ;

INSERT INTO time_info (time_id,course_time)
VALUES ('1','一567'),
('2','二34'),
('3','三234'),
('4','三56'),
('5','四567'),
('6','五234'),
('7','五4');

/*===========================*/



/*===========================*/
/* course_info */

#DROP TABLE courses_info;

CREATE TABLE courses_info (
	course_id	INTEGER,
    semester	varchar(4),
	course_no	varchar(10),
	course_name	varchar(255),
	course_type	varchar(10),
    time_id	INTEGER,
    course_room	varchar(20),
	course_building	varchar(20),
	course_credit	INTEGER,
	course_limit	INTEGER,
	course_status	varchar(10),
    field_no		INTEGER,
    teacher_no		INTEGER,
    PRIMARY KEY (course_id),
    FOREIGN KEY (field_no) REFERENCES course_field(field_no),
    FOREIGN KEY (teacher_no) REFERENCES course_teacher(teacher_no),
    FOREIGN KEY (time_id) REFERENCES time_info(time_id)
) ;
INSERT INTO courses_info (course_id,semester,course_no,course_name,course_type,time_id,course_room,course_building,course_credit,course_limit,course_status,field_no,teacher_no)
VALUES ('1','1112','A0001','微積分','必修','1','K205','工程一館','2','50','開課','1','1'),
('2','1112','A0002','計算機概論','必修','2','L102','工程五館','3','50','開課','2','2'),
('3','1112','A0002','計算機概論','必修','2','L102','工程五館','3','50','開課','8','2'),
('4','1112','A0003','統計學習','選修','5','M-605','鴻經館','3','50','開課','6','3'),
('5','1112','A0003','統計學習','選修','5','M-605','鴻經館','3','50','開課','6','4'),
('6','1112','A0003','統計學習','選修','5','M-605','鴻經館','3','50','開課','7','3'),
('7','1112','A0003','統計學習','選修','5','M-605','鴻經館','3','50','開課','7','4'),
('8','1112','A0004','經濟學','必修','5','I1-018','管理二館','3','50','開課','8','5'),
('9','1112','A0005','統計學','選修','6','I1-304','管理二館','3','50','開課','8','6'),
('10','1112','A0006','音樂欣賞','選修','4','O-214','綜教館','2','100','開課','9','7'),
('11','1112','A0007','演算法','選修','3','L102','工程五館','3','50','開課','2','8'),
('12','1112','A0007','演算法','選修','3','L102','工程五館','3','50','開課','3','8'),
('13','1112','A0002','計算機概論','必修','7','L102','工程五館','3','50','開課','2','2'),
('14','1112','A0002','計算機概論','必修','7','L102','工程五館','3','50','開課','8','2');

select * from courses_info;

/*===========================*/

/*============================*/
/* students_course_result */
DROP TABLE students_course_result;
CREATE TABLE students_course_result (
	student_id	INTEGER,
    course_id	INTEGER,
    select_result	varchar(10),
    course_score	FLOAT,
	feedback_rank	INTEGER,
    PRIMARY KEY (student_id,course_id),
    FOREIGN KEY (course_id) REFERENCES courses_info(course_id)
);
INSERT INTO students_course_result(student_id,course_id,select_result,course_score,feedback_rank)
VALUES 
 ('1','1','中選',77.7,1),
 ('2','1','中選',NULL,NULL),
 ('3','1','中選',56,2),
 ('4','1','中選',34,3),
 ('5','1','中選',98,4),
 ('6','1','中選',55,5),
 ('7','1','中選',67,2),
 ('11','1','中選',NULL,NULL), 
 ('10','2','中選',66,3),
 ('10','13','中選',66,3),
 ('10','3','中選',66,3),
 ('10','14','中選',66,3),
 ('11','2','中選',NULL,NULL),
 ('11','13','中選',NULL,NULL),
 ('11','3','中選',NULL,NULL),
 ('11','14','中選',NULL,NULL),
 ('3','2','中選',93,4),
 ('3','13','中選',93,4),
 ('3','3','中選',93,4),
 ('3','14','中選',93,4),
 ('4','2','中選',44,4),
 ('4','13','中選',44,4),
 ('4','3','中選',44,4),
 ('4','14','中選',44,4),
 ('5','2','中選',49,5),
 ('5','13','中選',49,5),
 ('5','3','中選',49,5),
 ('5','14','中選',49,5),
 ('7','2','中選',78,3),
 ('7','13','中選',78,3),
 ('7','3','中選',78,3),
 ('7','14','中選',78,3),
 ('16','2','中選',NULL,NULL),
 ('16','13','中選',NULL,NULL),
 ('16','3','中選',NULL,NULL),
 ('16','14','中選',NULL,NULL),
 ('17','2','中選',74,5),
 ('17','13','中選',74,5),
 ('17','3','中選',74,5),
 ('17','14','中選',74,5),
 ('11','4','中選',NULL,NULL),
 ('11','6','中選',NULL,NULL),
 ('11','5','中選',NULL,NULL),
 ('11','7','中選',NULL,NULL),
 ('1','4','中選',46,5),
 ('1','6','中選',46,5),
 ('1','5','中選',46,5),
 ('1','7','中選',46,5),
 ('4','4','中選',76,4),
 ('4','6','中選',76,4),
 ('4','5','中選',76,4),
 ('4','7','中選',76,4),
 ('6','4','中選',87,5),
 ('6','6','中選',87,5),
 ('6','5','中選',87,5),
 ('6','7','中選',87,5),
 ('22','4','落選',NULL,NULL),
 ('22','6','落選',NULL,NULL),
 ('22','5','落選',NULL,NULL),
 ('22','7','落選',NULL,NULL),
 ('16','4','中選',NULL,NULL),
 ('16','6','中選',NULL,NULL),
 ('16','5','中選',NULL,NULL),
 ('16','7','中選',NULL,NULL),
 ('19','4','中選',78,3),
 ('19','6','中選',78,3),
 ('19','5','中選',78,3),
 ('19','7','中選',78,3),
 ('20','4','中選',65,4),
 ('20','6','中選',65,4),
 ('20','5','中選',65,4),
 ('20','7','中選',65,4),
 ('8','4','中選',99,3),
 ('8','6','中選',99,3),
 ('8','5','中選',99,3),
 ('8','7','中選',99,3),
 ('9','4','人工加選',69,1),
 ('9','6','人工加選',69,1),
 ('9','5','人工加選',69,1),
 ('9','7','人工加選',69,1),
 ('18','4','中選',76,4),
 ('18','6','中選',76,4),
 ('18','5','中選',76,4),
 ('18','7','中選',76,4),
 ('17','4','中選',80,5),
 ('17','6','中選',80,5),
 ('17','5','中選',80,5),
 ('17','7','中選',80,5),
 ('11','8','落選',NULL,NULL),
 ('1','8','中選',56,3),
 ('2','8','中選',NULL,NULL),
 ('4','8','中選',67.5,5),
 ('5','8','中選',78,4),
 ('7','8','中選',89,2),
 ('18','8','中選',45,5),
 ('10','9','中選',68.7,1),
 ('12','9','中選',63,4),
 ('13','9','中選',46,5),
 ('2','9','中選',NULL,NULL),
 ('3','9','中選',78,2),
 ('4','9','中選',87,3),
 ('22','9','中選',96,2),
 ('10','10','中選',76,4),
 ('11','10','中選',NULL,NULL),
 ('14','10','落選',NULL,NULL),
 ('15','10','落選',NULL,NULL),
 ('1','10','中選',34,3),
 ('2','10','落選',NULL,NULL),
 ('3','10','落選',NULL,NULL),
 ('4','10','中選',80,4),
 ('6','10','中選',62,5),
 ('7','10','中選',60,3),
 ('22','10','中選',56,5),
 ('16','10','中選',NULL,NULL),
 ('17','10','中選',98,4),
 ('19','10','中選',55,5),
 ('20','10','中選',78,5),
 ('1','12','落選',NULL,NULL),
 ('1','11','落選',NULL,NULL),
 ('16','12','中選',NULL,NULL),
 ('16','11','中選',NULL,NULL),
 ('18','12','中選',79,5),
 ('18','11','中選',79,5),
 ('21','12','中選',87,4),
 ('21','11','中選',87,4),
 ('17','12','中選',68,3),
 ('17','11','中選',68,3),
 ('11','12','中選',NULL,NULL),
 ('11','11','中選',NULL,NULL),
 ('8','12','中選',99,3),
 ('8','11','中選',99,3),
 ('9','12','中選',69,1),
 ('9','11','中選',69,1);

SELECT * FROM students_course_result;
/*============================*/

/*============================*/
/* students_info */
#DROP TABLE students_info;

CREATE TABLE students_info (
	student_id		INTEGER,
	student_name	varchar(20) NOT NULL,
    student_dept	varchar(30),
    student_grade	INTEGER,
	student_status	varchar(10),
    student_class	varchar(1),
    PRIMARY KEY (student_name),
    FOREIGN KEY (student_id) REFERENCES students_course_result(student_id)
) ;


INSERT INTO students_info (student_id,student_name,student_dept,student_grade,student_status,student_class)
VALUES ('1','張飛','數學系','1','在學','A'),
('2','孫尚香','數學系','1','休學','A'),
('3','周瑜','數學系','1','在學','A'),
('4','黃蓋','數學系','1','在學','A'),
('5','趙雲','數學系','1','在學','A'),
('6','關興','數學系','1','在學','A'),
('7','夏侯惇','數學系','1','在學','A'),
('8','圖靈','數學系碩士班','1','在學','A'),
('9','巴斯卡','數學系碩士班','1','在學','A'),
('10','關羽','資訊工程系','1','在學','A'),
('11','龐統','資訊工程系','1','休學','A'),
('12','大喬','資訊工程系','1','在學','A'),
('13','甘寧','資訊工程系','1','在學','A'),
('14','司馬昭','資訊工程系','1','在學','A'),
('15','馬超','資訊工程系','1','在學','A'),
('16','華雄','資訊工程研究所','1','退學','A'),
('17','華陀','資訊工程研究所','1','在學','A'),
('18','呂布','資訊工程研究所','1','在學','A'),
('19','諸葛亮','資訊工程研究所','1','在學','A'),
('20','呂蒙','資訊工程研究所','1','在學','A'),
('21','郭嘉','資訊工程研究所','1','在學','A'),
('22','劉備','資訊管理系','1','在學','A');


SELECT * FROM students_info ;
/*===========================*/



 

/*===========================*/
/* course_data */
DROP TABLE course_data;

CREATE TABLE course_data (
	student_id 		INTEGER,
	course_id		INTEGER,
	id 			varchar(10),
	
    FOREIGN KEY (student_id) REFERENCES students_info(student_id),
    FOREIGN KEY (course_id) REFERENCES courses_info(course_id)

);

INSERT INTO course_data (student_id,course_id,id)
 VALUES ('1','1','1'),
 ('2','1','2'),
 ('3','1','3'),
 ('4','1','4'),
 ('5','1','5'),
 ('6','1','6'),
 ('7','1','7'),
 ('11','1','8'), 
 ('10','2','9'),
 ('10','13','10'),
 ('10','3','11'),
 ('10','14','12'),
 ('11','2','13'),
 ('11','13','14'),
 ('11','3','15'),
 ('11','14','16'),
 ('3','2','17'),
 ('3','13','18'),
 ('3','3','19'),
 ('3','14','20'),
 ('4','2','21'),
 ('4','13','22'),
 ('4','3','23'),
 ('4','14','24'),
 ('5','2','25'),
 ('5','13','26'),
 ('5','3','27'),
 ('5','14','28'),
 ('7','2','29'),
 ('7','13','30'),
 ('7','3','31'),
 ('7','14','32'),
 ('16','2','33'),
 ('16','13','34'),
 ('16','3','35'),
 ('16','14','36'),
 ('17','2','37'),
 ('17','13','38'),
 ('17','3','39'),
 ('17','14','40'),
 ('11','4','41'),
 ('11','6','42'),
 ('11','5','43'),
 ('11','7','44'),
 ('1','4','45'),
 ('1','6','46'),
 ('1','5','47'),
 ('1','7','48'),
 ('4','4','49'),
 ('4','6','50'),
 ('4','5','51'),
 ('4','7','52'),
 ('6','4','53'),
 ('6','6','54'),
 ('6','5','55'),
 ('6','7','56'),
 ('22','4','57'),
 ('22','6','58'),
 ('22','5','59'),
 ('22','7','60'),
 ('16','4','61'),
 ('16','6','62'),
 ('16','5','63'),
 ('16','7','64'),
 ('19','4','65'),
 ('19','6','66'),
 ('19','5','67'),
 ('19','7','68'),
 ('20','4','69'),
 ('20','6','70'),
 ('20','5','71'),
 ('20','7','72'),
 ('8','4','73'),
 ('8','6','74'),
 ('8','5','75'),
 ('8','7','76'),
 ('9','4','77'),
 ('9','6','78'),
 ('9','5','79'),
 ('9','7','80'),
 ('18','4','81'),
 ('18','6','82'),
 ('18','5','83'),
 ('18','7','84'),
 ('17','4','85'),
 ('17','6','86'),
 ('17','5','87'),
 ('17','7','88'),
 ('11','8','89'),
 ('1','8','90'),
 ('2','8','91'),
 ('4','8','92'),
 ('5','8','93'),
 ('7','8','94'),
 ('18','8','95'),
 ('10','9','96'),
 ('12','9','97'),
 ('13','9','98'),
 ('2','9','99'),
 ('3','9','100'),
 ('4','9','101'),
 ('22','9','102'),
 ('10','10','103'),
 ('11','10','104'),
 ('14','10','105'),
 ('15','10','106'),
 ('1','10','107'),
 ('2','10','108'),
 ('3','10','109'),
 ('4','10','110'),
 ('6','10','111'),
 ('7','10','112'),
 ('22','10','113'),
 ('16','10','114'),
 ('17','10','115'),
 ('19','10','116'),
 ('20','10','117'),
 ('1','12','118'),
 ('1','11','119'),
 ('16','12','120'),
 ('16','11','121'),
 ('18','12','122'),
 ('18','11','123'),
 ('21','12','124'),
 ('21','11','125'),
 ('17','12','126'),
 ('17','11','127'),
 ('11','12','128'),
 ('11','11','129'),
 ('8','12','130'),
 ('8','11','131'),
 ('9','12','132'),
 ('9','11','133');

COMMIT ;
/*===========================*/

```

---

---

## 正確 ER圖及正規化圖待補

#### ER 圖
![](https://hackmd.io/_uploads/S1E7sAFBh.png)



#### 第一正規化



#### 第二正規化





#### 第三正規化


---

## 我改過的 QUERY
#### QA
1. 「A0001微積分」上課地點要由K205修改到K210 大教室，該怎麼做？
    ```
    SET SQL_SAFE_UPDATES=0;

    UPDATE courses_info
    SET course_room="K210"
    WHERE course_name = "微積分";
    
    SELECT DISTINCT course_name,course_room
    FROM courses_info;
    ```
    ![](https://hackmd.io/_uploads/B1C5BLc4h.png)
    ![](https://hackmd.io/_uploads/BJQsrU9Nn.png)

2.  請列出「A0002 計算機概論」的修課名單（點名表）。
    ```
    SELECT DISTINCT student_name
    FROM(
        SELECT students_info.student_id,student_name,course_no
        FROM students_info
        LEFT JOIN students_course_result
        ON students_info.student_id = students_course_result.student_id
        LEFT JOIN courses_info
        ON courses_info.course_id = students_course_result.course_id
    )AS A
    WHERE course_no = "A0002";
    ```
    ![](https://hackmd.io/_uploads/rkldjSLqEh.png)

3.  請列出課程成績不及格的學生比例資料（大學部：低於60分、碩博：70分），產出欄位範例如下：
    ```
    SELECT course_name,teacher_name,fail_num,total_num,fail_num/total_num as fail_rate
    FROM(
        SELECT course_name,M.teacher_name,fail_num,total_num
        FROM(
            SELECT DISTINCT  course_name,teacher_name,count(DISTINCT student_name) as fail_num
            FROM (
                SELECT *
                FROM(
                    SELECT course_name,student_name,teacher_name,student_dept,course_score,student_status,select_result
                    FROM(
                        SELECT course_name,student_name,students_info.student_id,student_dept,course_score,teacher_no,student_status,select_result
                        FROM students_info
                        LEFT JOIN students_course_result
                        ON students_info.student_id = students_course_result.student_id
                        LEFT JOIN courses_info
                        ON courses_info.course_id = students_course_result.course_id
                    ) AS a
                    LEFT JOIN course_teacher
                    ON course_teacher.teacher_no = a.teacher_no
                ) AS A
            )AS B
            WHERE (course_score < 70 AND ( student_dept LIKE '%研究所%' OR student_dept LIKE '%碩士班%' ) ) OR
                                  (course_score < 60 AND NOT ( student_dept LIKE '%研究所%' OR student_dept LIKE '%碩士班%' ) )
            GROUP BY course_name,teacher_name
        ) AS M
        LEFT JOIN (
            SELECT teacher_name,count(DISTINCT student_name) as total_num
            FROM(
                SELECT course_name,student_name,teacher_name,student_dept,course_score,student_status,select_result
                FROM(
                    SELECT course_name,student_name,students_info.student_id,student_dept,course_score,teacher_no,student_status,select_result
                    FROM students_info
                    LEFT JOIN students_course_result
                    ON students_info.student_id = students_course_result.student_id
                    LEFT JOIN courses_info
                    ON courses_info.course_id = students_course_result.course_id
                ) AS a
                LEFT JOIN course_teacher
                ON course_teacher.teacher_no = a.teacher_no
            ) AS A
            GROUP BY course_name,teacher_name) G
        ON M.teacher_name = G.teacher_name
    )AS Y;
    ```
    ![](https://hackmd.io/_uploads/Bkn_Fm0V3.png)




4. 請列出各系學生修課領域分佈情況，產出欄位範例如下：
    ```
    SELECT curriculum_field,people,total,people/total
    FROM(
    SELECT *
    FROM(
        SELECT curriculum_field as c,student_dept,count(DISTINCT student_id) as people
        FROM(
            SELECT DISTINCT students_info.student_id,field_no,student_dept
            FROM students_info
            LEFT JOIN students_course_result
            ON students_info.student_id = students_course_result.student_id
            LEFT JOIN courses_info
            ON courses_info.course_id = students_course_result.course_id
        )AS A
        LEFT JOIN course_field
        ON course_field.field_no = A.field_no
        GROUP BY student_dept,curriculum_field
    )AS C
    LEFT JOIN(
        SELECT curriculum_field,sum(num) as total
        FROM(
            SELECT curriculum_field,student_dept,count(DISTINCT student_id)as num 
            FROM(
                SELECT DISTINCT students_info.student_id,field_no,student_dept
                FROM students_info
                LEFT JOIN students_course_result
                ON students_info.student_id = students_course_result.student_id
                LEFT JOIN courses_info
                ON courses_info.course_id = students_course_result.course_id
            )AS A
            LEFT JOIN course_field
            ON course_field.field_no = A.field_no
            GROUP BY student_dept,curriculum_field
            )AS B
        GROUP BY(curriculum_field)
    )D
    ON C.c = D.curriculum_field
    )AS E
    ```
    ![](https://hackmd.io/_uploads/r1oSzNyr2.png)




    
5. 請列出教學評量平均分數及總分，產出欄位範例如下：
    ```
    SELECT DISTINCT course_name,teacher_name,sum(feedback_rank),avg(feedback_rank)
    FROM(
        SELECT DISTINCT student_name,course_name,feedback_rank,teacher_no
        FROM students_info
        LEFT JOIN students_course_result
        ON students_info.student_id = students_course_result.student_id
        LEFT JOIN courses_info
        ON courses_info.course_id = students_course_result.course_id
        WHERE feedback_rank IS NOT NULL
    )AS A
    LEFT JOIN course_teacher
    ON course_teacher.teacher_no = A.teacher_no
    GROUP BY course_name,teacher_name
    ```
    ![](https://hackmd.io/_uploads/ByJNtQCEn.png)




## 原本的 code

```mysql=

START TRANSACTION;
CREATE DATABASE final_project;
USE final_project ;

/*============================*/
/* course_field */
#DROP TABLE course_field;
CREATE TABLE course_field (
   	field_no	          INTEGER NOT NULL,
   	curriculum_field	TEXT ,
	PRIMARY KEY (field_no)
);
   
INSERT INTO course_field (field_no,curriculum_field)
 VALUES ('1', '理論數學'), 
 ('2', '人工智慧'), 
 ('3', '資料科學'), 
 ('4', '多媒體'),
 ('5', '資料科學'), 
 ('6', '財務工程'), 
 ('7', '統計推論'), 
 ('8', '基礎知識'), 
 ('9', '人文思想');
   
SELECT * FROM course_field ;
/*===========================*/



/*============================*/
/* course_teacher */
#DROP TABLE course_teacher;
CREATE TABLE course_teacher (
	teacher_no	INTEGER NOT NULL,
	teacher_name	varchar(20),
    PRIMARY KEY (teacher_no)
);
INSERT INTO course_teacher (teacher_no,teacher_name)
 VALUES ('1','岳飛'),
 ('2','陸羽'),
 ('3','劉邦'),
 ('4','項羽'),
 ('5','孔丘'),
 ('6','莊周'),
 ('7','巴哈'),
 ('8','達文西');
 
SELECT * FROM course_teacher;

/*============================*/


/*============================*/
/* students_info */

CREATE TABLE students_info (
	student_name	varchar(20) NOT NULL,
    student_dept	varchar(30),
    student_grade	INTEGER,
	student_status	varchar(10),
    student_class	varchar(1),
    PRIMARY KEY (student_name)
) ;

INSERT INTO students_info (student_name,student_dept,student_grade,student_status,student_class)
VALUES ('張飛','數學系','1','在學','A'),
('孫尚香','數學系','1','休學','A'),
('周瑜','數學系','1','在學','A'),
('黃蓋','數學系','1','在學','A'),
('趙雲','數學系','1','在學','A'),
('關興','數學系','1','在學','A'),
('夏侯惇','數學系','1','在學','A'),
('圖靈','數學系碩士班','1','在學','A'),
('巴斯卡','數學系碩士班','1','在學','A'),
('關羽','資訊工程系','1','在學','A'),
('龐統','資訊工程系','1','休學','A'),
('大喬','資訊工程系','1','在學','A'),
('甘寧','資訊工程系','1','在學','A'),
('司馬昭','資訊工程系','1','在學','A'),
('馬超','資訊工程系','1','在學','A'),
('華雄','資訊工程研究所','1','退學','A'),
('華陀','資訊工程研究所','1','在學','A'),
('呂布','資訊工程研究所','1','在學','A'),
('諸葛亮','資訊工程研究所','1','在學','A'),
('呂蒙','資訊工程研究所','1','在學','A'),
('郭嘉','資訊工程研究所','1','在學','A'),
('劉備','資訊管理系','1','在學','A');


SELECT * FROM students_info ;
/*===========================*/



/*===========================*/
/* course_info */

#DROP TABLE courses_info;

CREATE TABLE courses_info (
	course_id	INTEGER,
	course_no	varchar(10),
	course_name	varchar(255),
	course_type	varchar(10),
    course_time	varchar(20),
    course_room	varchar(20),
	course_building	varchar(20),
	course_credit	INTEGER,
	course_limit	INTEGER,
	course_status	varchar(10),
    field_no		INTEGER,
    teacher_no		INTEGER,
    PRIMARY KEY (course_id),
    FOREIGN KEY (field_no) REFERENCES course_field(field_no),
    FOREIGN KEY (teacher_no) REFERENCES course_teacher(teacher_no)
) ;
INSERT INTO courses_info (course_id,course_no,course_name,course_type,course_time,course_room,course_building,course_credit,course_limit,course_status,field_no,teacher_no)
VALUES ('1','A0001','微積分','必修','一567','K205','工程一館','2','50','開課','1','1'),
('2','A0002','計算機概論','必修','二34,五4','L102','工程五館','3','50','開課','2','2'),
('3','A0002','計算機概論','必修','二34,五4','L102','工程五館','3','50','開課','8','2'),
('4','A0003','統計學習','選修','四567','M-605','鴻經館','3','50','開課','6','3'),
('5','A0003','統計學習','選修','四567','M-605','鴻經館','3','50','開課','6','4'),
('6','A0003','統計學習','選修','四567','M-605','鴻經館','3','50','開課','7','3'),
('7','A0003','統計學習','選修','四567','M-605','鴻經館','3','50','開課','7','4'),
('8','A0004','經濟學','必修','四567','I1-018','管理二館','3','50','開課','8','5'),
('9','A0005','統計學','選修','五234','I1-304','管理二館','3','50','開課','8','6'),
('10','A0006','音樂欣賞','選修','三56','O-214','綜教館','2','100','開課','9','7'),
('11','A0007','演算法','選修','三234','L102','工程五館','3','50','開課','2','8'),
('12','A0007','演算法','選修','三234','L102','工程五館','3','50','開課','3','8');

select * from courses_info;

/*===========================*/

 

/*===========================*/
/* course_data */
# DROP TABLE course_data;

CREATE TABLE course_data (
	course_id		INTEGER,
	id 			varchar(10),
	semester	varchar(4),
	course_no	varchar(10),
	course_name	varchar(255),
	course_type	varchar(10),
	course_room	varchar(20),
	course_building	varchar(20),
	course_time	varchar(20),
	course_credit	INTEGER,
	course_limit	INTEGER,
	course_status	varchar(10),
	teacher_name	varchar(20),
	student_name	varchar(20),
	student_dept	varchar(30),
	student_grade	INTEGER,
	student_status	varchar(10),
	curriculum_field	TEXT,
	student_class	varchar(1),
	select_result	varchar(10),
	course_score	NUMERIC,
	feedback_rank	INTEGER,
    FOREIGN KEY (student_name) REFERENCES students_info(student_name),
    FOREIGN KEY (course_id) REFERENCES courses_info(course_id)
);

INSERT INTO course_data (course_id,id,semester,course_no,course_name,course_type,course_room,course_building,course_time,course_credit,course_limit,course_status,teacher_name,student_name,student_dept,student_grade,student_status,curriculum_field,student_class,select_result,course_score,feedback_rank)
 VALUES ('1','1','1112','A0001','微積分','必修','K205','工程一館','一567',2,50,'開課','岳飛','張飛','數學系',1,'在學','理論數學','A','中選',77.7,1),
 ('1','2','1112','A0001','微積分','必修','K205','工程一館','一567',2,50,'開課','岳飛','孫尚香','數學系',1,'休學','理論數學','A','中選',NULL,NULL),
 ('1','3','1112','A0001','微積分','必修','K205','工程一館','一567',2,50,'開課','岳飛','周瑜','數學系',1,'在學','理論數學','A','中選',56,2),
 ('1','4','1112','A0001','微積分','必修','K205','工程一館','一567',2,50,'開課','岳飛','黃蓋','數學系',1,'在學','理論數學','A','中選',34,3),
 ('1','5','1112','A0001','微積分','必修','K205','工程一館','一567',2,50,'開課','岳飛','趙雲','數學系',1,'在學','理論數學','A','中選',98,4),
 ('1','6','1112','A0001','微積分','必修','K205','工程一館','一567',2,50,'開課','岳飛','關興','數學系',1,'在學','理論數學','A','中選',55,5),
 ('1','7','1112','A0001','微積分','必修','K205','工程一館','一567',2,50,'開課','岳飛','夏侯惇','數學系',1,'在學','理論數學','A','中選',67,2),
 ('1','8','1112','A0001','微積分','必修','K205','工程一館','一567',2,50,'開課','岳飛','龐統','資訊工程系',1,'休學','理論數學','A','中選',NULL,NULL), 
 ('2','9','1112','A0002','計算機概論','必修','L102','工程五館','二34,五4',3,50,'開課','陸羽','關羽','資訊工程系',1,'在學','基礎知識','A','中選',66,3),
 ('3','10','1112','A0002','計算機概論','必修','L102','工程五館','二34,五4',3,50,'開課','陸羽','關羽','資訊工程系',1,'在學','人工智慧','A','中選',66,3),
 ('2','11','1112','A0002','計算機概論','必修','L102','工程五館','二34,五4',3,50,'開課','陸羽','龐統','資訊工程系',1,'休學','基礎知識','A','中選',NULL,NULL),
 ('3','12','1112','A0002','計算機概論','必修','L102','工程五館','二34,五4',3,50,'開課','陸羽','龐統','資訊工程系',1,'休學','人工智慧','A','中選',NULL,NULL),
 ('2','13','1112','A0002','計算機概論','必修','L102','工程五館','二34,五4',3,50,'開課','陸羽','周瑜','數學系',1,'在學','基礎知識','A','中選',93,4),
 ('3','14','1112','A0002','計算機概論','必修','L102','工程五館','二34,五4',3,50,'開課','陸羽','周瑜','數學系',1,'在學','人工智慧','A','中選',93,4),
 ('2','15','1112','A0002','計算機概論','必修','L102','工程五館','二34,五4',3,50,'開課','陸羽','黃蓋','數學系',1,'在學','基礎知識','A','中選',44,4),
 ('3','16','1112','A0002','計算機概論','必修','L102','工程五館','二34,五4',3,50,'開課','陸羽','黃蓋','數學系',1,'在學','人工智慧','A','中選',44,4),
 ('2','17','1112','A0002','計算機概論','必修','L102','工程五館','二34,五4',3,50,'開課','陸羽','趙雲','數學系',1,'在學','基礎知識','A','中選',49,5),
 ('3','18','1112','A0002','計算機概論','必修','L102','工程五館','二34,五4',3,50,'開課','陸羽','趙雲','數學系',1,'在學','人工智慧','A','中選',49,5),
 ('2','19','1112','A0002','計算機概論','必修','L102','工程五館','二34,五4',3,50,'開課','陸羽','夏侯惇','數學系',1,'在學','基礎知識','A','中選',78,3),
 ('3','20','1112','A0002','計算機概論','必修','L102','工程五館','二34,五4',3,50,'開課','陸羽','夏侯惇','數學系',1,'在學','人工智慧','A','中選',78,3),
 ('2','21','1112','A0002','計算機概論','必修','L102','工程五館','二34,五4',3,50,'開課','陸羽','華雄','資訊工程研究所',1,'退學','基礎知識','A','中選',NULL,NULL),
 ('3','22','1112','A0002','計算機概論','必修','L102','工程五館','二34,五4',3,50,'開課','陸羽','華雄','資訊工程研究所',1,'退學','人工智慧','A','中選',NULL,NULL),
 ('2','23','1112','A0002','計算機概論','必修','L102','工程五館','二34,五4',3,50,'開課','陸羽','華陀','資訊工程研究所',1,'在學','基礎知識','A','中選',74,5),
 ('3','24','1112','A0002','計算機概論','必修','L102','工程五館','二34,五4',3,50,'開課','陸羽','華陀','資訊工程研究所',1,'在學','人工智慧','A','中選',74,5),
 ('4','25','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','劉邦','龐統','資訊工程系',1,'休學','財務工程','A','中選',NULL,NULL),
 ('6','26','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','劉邦','龐統','資訊工程系',1,'休學','統計推論','A','中選',NULL,NULL),
 ('5','27','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','項羽','龐統','資訊工程系',1,'休學','財務工程','A','中選',NULL,NULL),
 ('7','28','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','項羽','龐統','資訊工程系',1,'休學','統計推論','A','中選',NULL,NULL),
 ('4','29','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','劉邦','張飛','數學系',1,'在學','財務工程','A','中選',46,5),
 ('6','30','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','劉邦','張飛','數學系',1,'在學','統計推論','A','中選',46,5),
 ('5','31','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','項羽','張飛','數學系',1,'在學','財務工程','A','中選',46,5),
 ('7','32','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','項羽','張飛','數學系',1,'在學','統計推論','A','中選',46,5),
 ('4','33','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','劉邦','黃蓋','數學系',1,'在學','財務工程','A','中選',76,4),
 ('6','34','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','劉邦','黃蓋','數學系',1,'在學','統計推論','A','中選',76,4),
 ('5','35','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','項羽','黃蓋','數學系',1,'在學','財務工程','A','中選',76,4),
 ('7','36','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','項羽','黃蓋','數學系',1,'在學','統計推論','A','中選',76,4),
 ('4','37','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','劉邦','關興','數學系',1,'在學','財務工程','A','中選',87,5),
 ('6','38','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','劉邦','關興','數學系',1,'在學','統計推論','A','中選',87,5),
 ('5','39','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','項羽','關興','數學系',1,'在學','財務工程','A','中選',87,5),
 ('7','40','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','項羽','關興','數學系',1,'在學','統計推論','A','中選',87,5),
 ('4','41','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','劉邦','劉備','資訊管理系',1,'在學','財務工程','A','落選',NULL,NULL),
 ('6','42','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','劉邦','劉備','資訊管理系',1,'在學','統計推論','A','落選',NULL,NULL),
 ('5','43','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','項羽','劉備','資訊管理系',1,'在學','財務工程','A','落選',NULL,NULL),
 ('7','44','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','項羽','劉備','資訊管理系',1,'在學','統計推論','A','落選',NULL,NULL),
 ('4','45','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','劉邦','華雄','資訊工程研究所',1,'退學','財務工程','A','中選',NULL,NULL),
 ('6','46','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','劉邦','華雄','資訊工程研究所',1,'退學','統計推論','A','中選',NULL,NULL),
 ('5','47','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','項羽','華雄','資訊工程研究所',1,'退學','財務工程','A','中選',NULL,NULL),
 ('7','48','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','項羽','華雄','資訊工程研究所',1,'退學','統計推論','A','中選',NULL,NULL),
 ('4','49','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','劉邦','諸葛亮','資訊工程研究所',1,'在學','財務工程','A','中選',78,3),
 ('6','50','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','劉邦','諸葛亮','資訊工程研究所',1,'在學','統計推論','A','中選',78,3),
 ('5','51','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','項羽','諸葛亮','資訊工程研究所',1,'在學','財務工程','A','中選',78,3),
 ('7','52','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','項羽','諸葛亮','資訊工程研究所',1,'在學','統計推論','A','中選',78,3),
 ('4','53','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','劉邦','呂蒙','資訊工程研究所',1,'在學','財務工程','A','中選',65,4),
 ('6','54','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','劉邦','呂蒙','資訊工程研究所',1,'在學','統計推論','A','中選',65,4),
 ('5','55','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','項羽','呂蒙','資訊工程研究所',1,'在學','財務工程','A','中選',65,4),
 ('7','56','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','項羽','呂蒙','資訊工程研究所',1,'在學','統計推論','A','中選',65,4),
 ('4','57','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','劉邦','圖靈','數學系碩士班',1,'在學','財務工程','A','中選',99,3),
 ('6','58','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','劉邦','圖靈','數學系碩士班',1,'在學','統計推論','A','中選',99,3),
 ('5','59','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','項羽','圖靈','數學系碩士班',1,'在學','財務工程','A','中選',99,3),
 ('7','60','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','項羽','圖靈','數學系碩士班',1,'在學','統計推論','A','中選',99,3),
 ('4','61','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','劉邦','巴斯卡','數學系碩士班',1,'在學','財務工程','A','人工加選',69,1),
 ('6','62','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','劉邦','巴斯卡','數學系碩士班',1,'在學','統計推論','A','人工加選',69,1),
 ('5','63','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','項羽','巴斯卡','數學系碩士班',1,'在學','財務工程','A','人工加選',69,1),
 ('7','64','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','項羽','巴斯卡','數學系碩士班',1,'在學','統計推論','A','人工加選',69,1),
 ('4','65','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','劉邦','呂布','資訊工程研究所',1,'在學','財務工程','A','中選',76,4),
 ('6','66','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','劉邦','呂布','資訊工程研究所',1,'在學','統計推論','A','中選',76,4),
 ('5','67','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','項羽','呂布','資訊工程研究所',1,'在學','財務工程','A','中選',76,4),
 ('7','68','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','項羽','呂布','資訊工程研究所',1,'在學','統計推論','A','中選',76,4),
 ('4','69','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','劉邦','華陀','資訊工程研究所',1,'在學','財務工程','A','中選',80,5),
 ('6','70','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','劉邦','華陀','資訊工程研究所',1,'在學','統計推論','A','中選',80,5),
 ('5','71','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','項羽','華陀','資訊工程研究所',1,'在學','財務工程','A','中選',80,5),
 ('7','72','1112','A0003','統計學習','選修','M-605','鴻經館','四567',3,50,'開課','項羽','華陀','資訊工程研究所',1,'在學','統計推論','A','中選',80,5),
 ('8','73','1112','A0004','經濟學','必修','I1-018','管理二館','四567',3,50,'開課','孔丘','龐統','資訊工程系',1,'休學','基礎知識','A','落選',NULL,NULL),
 ('8','74','1112','A0004','經濟學','必修','I1-018','管理二館','四567',3,50,'開課','孔丘','張飛','數學系',1,'在學','基礎知識','A','中選',56,3),
 ('8','75','1112','A0004','經濟學','必修','I1-018','管理二館','四567',3,50,'開課','孔丘','孫尚香','數學系',1,'休學','基礎知識','A','中選',NULL,NULL),
 ('8','76','1112','A0004','經濟學','必修','I1-018','管理二館','四567',3,50,'開課','孔丘','黃蓋','數學系',1,'在學','基礎知識','A','中選',67.5,5),
 ('8','77','1112','A0004','經濟學','必修','I1-018','管理二館','四567',3,50,'開課','孔丘','趙雲','數學系',1,'在學','基礎知識','A','中選',78,4),
 ('8','78','1112','A0004','經濟學','必修','I1-018','管理二館','四567',3,50,'開課','孔丘','夏侯惇','數學系',1,'在學','基礎知識','A','中選',89,2),
 ('8','79','1112','A0004','經濟學','必修','I1-018','管理二館','四567',3,50,'開課','孔丘','呂布','資訊工程研究所',1,'在學','基礎知識','A','中選',45,5),
 ('9','80','1112','A0005','統計學','選修','I1-304','管理二館','五234',3,50,'開課','莊周','關羽','資訊工程系',1,'在學','基礎知識','A','中選',68.7,1),
 ('9','81','1112','A0005','統計學','選修','I1-304','管理二館','五234',3,50,'開課','莊周','大喬','資訊工程系',1,'在學','基礎知識','A','中選',63,4),
 ('9','82','1112','A0005','統計學','選修','I1-304','管理二館','五234',3,50,'開課','莊周','甘寧','資訊工程系',1,'在學','基礎知識','A','中選',46,5),
 ('9','83','1112','A0005','統計學','選修','I1-304','管理二館','五234',3,50,'開課','莊周','孫尚香','數學系',1,'休學','基礎知識','A','中選',NULL,NULL),
 ('9','84','1112','A0005','統計學','選修','I1-304','管理二館','五234',3,50,'開課','莊周','周瑜','數學系',1,'在學','基礎知識','A','中選',78,2),
 ('9','85','1112','A0005','統計學','選修','I1-304','管理二館','五234',3,50,'開課','莊周','黃蓋','數學系',1,'在學','基礎知識','A','中選',87,3),
 ('9','86','1112','A0005','統計學','選修','I1-304','管理二館','五234',3,50,'開課','莊周','劉備','資訊管理系',1,'在學','基礎知識','A','中選',96,2),
 ('10','87','1112','A0006','音樂欣賞','選修','O-214','綜教館','三56',2,100,'開課','巴哈','關羽','資訊工程系',1,'在學','人文思想','A','中選',76,4),
 ('10','88','1112','A0006','音樂欣賞','選修','O-214','綜教館','三56',2,100,'開課','巴哈','龐統','資訊工程系',1,'休學','人文思想','A','中選',NULL,NULL),
 ('10','89','1112','A0006','音樂欣賞','選修','O-214','綜教館','三56',2,100,'開課','巴哈','司馬昭','資訊工程系',1,'在學','人文思想','A','落選',NULL,NULL),
 ('10','90','1112','A0006','音樂欣賞','選修','O-214','綜教館','三56',2,100,'開課','巴哈','馬超','資訊工程系',1,'在學','人文思想','A','落選',NULL,NULL),
 ('10','91','1112','A0006','音樂欣賞','選修','O-214','綜教館','三56',2,100,'開課','巴哈','張飛','數學系',1,'在學','人文思想','A','中選',34,3),
 ('10','92','1112','A0006','音樂欣賞','選修','O-214','綜教館','三56',2,100,'開課','巴哈','孫尚香','數學系',1,'休學','人文思想','A','落選',NULL,NULL),
 ('10','93','1112','A0006','音樂欣賞','選修','O-214','綜教館','三56',2,100,'開課','巴哈','周瑜','數學系',1,'在學','人文思想','A','落選',NULL,NULL),
 ('10','94','1112','A0006','音樂欣賞','選修','O-214','綜教館','三56',2,100,'開課','巴哈','黃蓋','數學系',1,'在學','人文思想','A','中選',80,4),
 ('10','95','1112','A0006','音樂欣賞','選修','O-214','綜教館','三56',2,100,'開課','巴哈','關興','數學系',1,'在學','人文思想','A','中選',62,5),
 ('10','96','1112','A0006','音樂欣賞','選修','O-214','綜教館','三56',2,100,'開課','巴哈','夏侯惇','數學系',1,'在學','人文思想','A','中選',60,3),
 ('10','97','1112','A0006','音樂欣賞','選修','O-214','綜教館','三56',2,100,'開課','巴哈','劉備','資訊管理系',1,'在學','人文思想','A','中選',56,5),
 ('10','98','1112','A0006','音樂欣賞','選修','O-214','綜教館','三56',2,100,'開課','巴哈','華雄','資訊工程研究所',1,'退學','人文思想','A','中選',NULL,NULL),
 ('10','99','1112','A0006','音樂欣賞','選修','O-214','綜教館','三56',2,100,'開課','巴哈','華陀','資訊工程研究所',1,'在學','人文思想','A','中選',98,4),
 ('10','100','1112','A0006','音樂欣賞','選修','O-214','綜教館','三56',2,100,'開課','巴哈','諸葛亮','資訊工程研究所',1,'在學','人文思想','A','中選',55,5),
 ('10','101','1112','A0006','音樂欣賞','選修','O-214','綜教館','三56',2,100,'開課','巴哈','呂蒙','資訊工程研究所',1,'在學','人文思想','A','中選',78,5),
 ('12','102','1112','A0007','演算法','選修','L102','工程五館','三234',3,50,'開課','達文西','張飛','數學系',1,'在學','人工智慧','A','落選',NULL,NULL),
 ('11','103','1112','A0007','演算法','選修','L102','工程五館','三234',3,50,'開課','達文西','張飛','數學系',1,'在學','資料科學','A','落選',NULL,NULL),
 ('12','104','1112','A0007','演算法','選修','L102','工程五館','三234',3,50,'開課','達文西','華雄','資訊工程研究所',1,'退學','人工智慧','A','中選',NULL,NULL),
 ('11','105','1112','A0007','演算法','選修','L102','工程五館','三234',3,50,'開課','達文西','華雄','資訊工程研究所',1,'退學','資料科學','A','中選',NULL,NULL),
 ('12','106','1112','A0007','演算法','選修','L102','工程五館','三234',3,50,'開課','達文西','呂布','資訊工程研究所',1,'在學','人工智慧','A','中選',79,5),
 ('11','107','1112','A0007','演算法','選修','L102','工程五館','三234',3,50,'開課','達文西','呂布','資訊工程研究所',1,'在學','資料科學','A','中選',79,5),
 ('12','108','1112','A0007','演算法','選修','L102','工程五館','三234',3,50,'開課','達文西','郭嘉','資訊工程研究所',1,'在學','人工智慧','A','中選',87,4),
 ('11','109','1112','A0007','演算法','選修','L102','工程五館','三234',3,50,'開課','達文西','郭嘉','資訊工程研究所',1,'在學','資料科學','A','中選',87,4),
 ('12','110','1112','A0007','演算法','選修','L102','工程五館','三234',3,50,'開課','達文西','華陀','資訊工程研究所',1,'在學','人工智慧','A','中選',68,3),
 ('11','111','1112','A0007','演算法','選修','L102','工程五館','三234',3,50,'開課','達文西','華陀','資訊工程研究所',1,'在學','資料科學','A','中選',68,3),
 ('12','112','1112','A0007','演算法','選修','L102','工程五館','三234',3,50,'開課','達文西','龐統','資訊工程系',1,'休學','人工智慧','A','中選',NULL,NULL),
 ('11','113','1112','A0007','演算法','選修','L102','工程五館','三234',3,50,'開課','達文西','龐統','資訊工程系',1,'休學','資料科學','A','中選',NULL,NULL),
 ('12','114','1112','A0007','演算法','選修','L102','工程五館','三234',3,50,'開課','達文西','圖靈','數學系碩士班',1,'在學','人工智慧','A','中選',99,3),
 ('11','115','1112','A0007','演算法','選修','L102','工程五館','三234',3,50,'開課','達文西','圖靈','數學系碩士班',1,'在學','資料科學','A','中選',99,3),
 ('12','116','1112','A0007','演算法','選修','L102','工程五館','三234',3,50,'開課','達文西','巴斯卡','數學系碩士班',1,'在學','人工智慧','A','中選',69,1),
 ('11','117','1112','A0007','演算法','選修','L102','工程五館','三234',3,50,'開課','達文西','巴斯卡','數學系碩士班',1,'在學','資料科學','A','中選',69,1);

COMMIT ;

SELECT * FROM course_data ;
/*===========================*/
```