1 / 23

高等資料庫管理系統 Advanced Database Management System

高等資料庫管理系統 Advanced Database Management System. 作業一 - Using DBMS. 系 所:數位知識管理 班 級:研究所一年級 學  生: 69739001 姓 名:王詩齡. 一、開發環境:. JDK 1.5.0.04 Apache Tomcat 5.5.9 MySQL 5.0.45 Navicat MySQL 7.2.8 Macromedia Dreamweaver 8. 1/22. 二、 ER DIAGRAM. 2/22. 三、 RELATION SCHEMA. Manager.

tareq
Download Presentation

高等資料庫管理系統 Advanced Database Management System

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 高等資料庫管理系統Advanced Database Management System 作業一-Using DBMS 系 所:數位知識管理 班 級:研究所一年級 學  生:69739001 姓 名:王詩齡

  2. 一、開發環境: • JDK 1.5.0.04 • Apache Tomcat 5.5.9 • MySQL 5.0.45 • Navicat MySQL 7.2.8 • Macromedia Dreamweaver 8 1/22

  3. 二、ER DIAGRAM 2/22

  4. 三、RELATION SCHEMA Manager Course Choose Student 3/22

  5. 四、DDL(定義) CREATE TABLE `Student` ( `SID` INT NOT NULL, `sname` varchar(20), `sex` varchar(5), `grade` INT, `address` varchar(50), `stel` varchar(20), PRIMARY KEY (`SID`)); CREATE TABLE `Choose` ( `C_ID` INT NOT NULL, `S_ID` INT NOT NULL, `score` INT, PRIMARY KEY (`C_ID`,`S_ID`)); alter table `Course` add constraint foreign key(`M_ID`) references `Manager`(`MID`); alter table `Choose` add constraint foreign key(`C_ID`) references `Course`(`CID`); alter table `Choose` add constraint foreign key(`S_ID`) references `Student`(`SID`); 【 定義資料表 】 (未包含資料匯入) CREATE TABLE `Manager` ( `MID` INT NOT NULL, `loginname` varchar(20), `password` varchar(20), `chname` varchar(20), `e-mail` varchar(30), `title` varchar(20), `office` varchar(20), `mtel` varchar(20), PRIMARY KEY (`ID`)); CREATE TABLE `Course` ( `CID` INT NOT NULL, `number` INT, `cname` varchar(50), `time` varchar(20), `classroom` varchar(20), `M_ID` INT NOT NULL, PRIMARY KEY (`CID`)); 4/22

  6. 四、DDL(建立、變更、刪除資料表) 【 建立資料表 】 CREATE TABLE `college` ( `number` INT NOT NULL, `name` varchar(30), PRIMARY KEY (`number`)); 【 變更資料表//新增欄位 】 alter table college add note char(100); 【 變更資料表//修改欄位 】 alter table college modify note varchar(300) not null; 【 變更資料表//刪除欄位 】 alter table college drop note; 【 刪除資料表 】 drop table college; 6/22

  7. 五、DML(新增、查詢、修改、刪除) 【 新增資料 】 INSERT INTO course VALUES ('9',' '543209','資料庫管理系統實務','/一4/一5/一6','共A103','10001'); 【 查詢資料 】 SELECT * FROM course WHERE cname='資料庫管理系統實務'; 【 修改資料 】 UPDATE course SET time='/一9/一10/一11',classroom='共四講堂' WHERE cname='資料庫管理系統實務'; 【 刪除資料 】 DELETE FROM course WHERE cname='資料庫管理系統實務'; 6/22

  8. 六、景觀VIEW 【 e.g. 建立自己的成績表 】 CREATE view work AS SELECT SID, cname, sname, score FROM Course, Choose, Student WHERE C_ID=CID AND S_ID=SID AND SID=69739001; 7/22

  9. 六、景觀VIEW 【 e.g. 建立各課程選課人數及分數總平均 】 CREATE view work1 AS SELECT CID, cname, COUNT(*), AVG(score) FROM Course, Choose WHERE C_ID=CID GROUP BY cname; 8/22

  10. 七、QUERY CATALOG 【 使用 Navicat MySQL 查詢 】 9/22

  11. 七、QUERY CATALOG 【 使用 Navicat MySQL 查詢 】 10/22

  12. 八、EMBEDDED SQL 【 課程管理系統 】使用 Java撰寫 JSP + SQL 程式碼:抓取所有課程資訊或依關鍵字查詢 11/22

  13. 八、EMBEDDED SQL 展示畫面:抓取所有課程及教師資訊 12/22

  14. 八、EMBEDDED SQL 展示畫面:依課程名稱查詢 展示畫面:依上課時段查詢 13/22

  15. 八、EMBEDDED SQL 程式碼:管理者介面,抓取所有課程資訊 14/22

  16. 八、EMBEDDED SQL 展示畫面:管理者介面,抓取所有課程資訊 15/22

  17. 八、EMBEDDED SQL 程式碼:課程新增 16/22

  18. 八、EMBEDDED SQL 展示畫面:課程新增 17/22

  19. 八、EMBEDDED SQL 程式碼:課程修改 18/22

  20. 八、EMBEDDED SQL 展示畫面:課程修改 19/22

  21. 八、EMBEDDED SQL 程式碼:課程刪除 20/22

  22. 八、EMBEDDED SQL 展示畫面:課程刪除 21/22

  23. 報告完畢 敬請指教 22/22

More Related