 
 CREATE TABLE IF NOT EXISTS `thang_diem` (
   `ID` int(10) unsigned NOT NULL,
-  `THANG_DIEM` varchar(60) COLLATE utf8_bin NOT NULL,
-  `TD_AP_DUNG` date NOT NULL,
-  `BAC` tinyint(1) NOT NULL
+  `THANG_DIEM` varchar(150) COLLATE utf8_bin NOT NULL,
+  `TD_AP_DUNG` date NOT NULL
 ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
 
 --
 -- Dumping data for table `thang_diem`
 --
 
-INSERT INTO `thang_diem` (`ID`, `THANG_DIEM`, `TD_AP_DUNG`, `BAC`) VALUES
-(1, '[A=9-Y,B+=8-Y,B=7-Y,C+=6.5-Y,C=6-Y,D+=5-Y,D=4.0-Y,F=0-N]', '2010-08-01', 0),
-(2, '[A=9-Y,B+=8-Y,B=7-Y,C+=6.5-Y,C=6-Y,D+=5-N,D=4.0-N,F=0-N]', '2010-08-01', 1);
+INSERT INTO `thang_diem` (`ID`, `THANG_DIEM`, `TD_AP_DUNG`) VALUES
+(1, 'A-9-Y-Y-4.0,B-7-Y-Y-3.0,C-6-Y-Y-2.0,D-4.0-Y-Y-1.0,F-0-N-N-0,M-11-Y-N-5,I-11-N-N-5,W-11-N-N-5', '2010-08-01'),
+(2, 'A-9-Y-Y-4.0,B+-8-Y-Y-3.5,B-7-Y-Y-3.0,C+-6.5-Y-Y-2.5,C-6-Y-Y-2.0,D+-5-Y-Y-1.5,D-4.0-Y-Y-1.0,F-0-N-N-0,M-11-Y-N-5,I-11-N-N-5,W-11-N-N-5', '2012-08-01');
 
 -- --------------------------------------------------------
 

-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Nov 10, 2015 at 06:56 AM
-- Server version: 5.6.24
-- PHP Version: 5.6.8


		INNER JOIN khoa ON khoa.ID = sv.ID_KHOA 
		INNER JOIN cn ON cn.ID = sv.ID_CN 
	WHERE sv.ID = `id_sv`;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_tt_thang_diem`()
BEGIN
	SELECT
		thang_diem.ID,
		thang_diem.THANG_DIEM,
		DATE_FORMAT(thang_diem.TD_AP_DUNG,'%d/%m/%Y') as NGAY_AP_DUNG
	FROM
		thang_diem
	WHERE
		thang_diem.TD_AP_DUNG = (SELECT max(thang_diem.TD_AP_DUNG) FROM thang_diem);
END$$

DELIMITER ;
