Tên:Phạm Hoàng Phúc Nguyên Student Code: SE62075 CLASS:SE1069 SELECT stuName'Name',tblStudent.stuBirthdate'Birthday' FROM tblStudent WHERE YEAR(stuBirthdate)='1990' SELECT insSSN'Code',insName'Name' FROM tblInstructor WHERE insSSN IN (SELECT insSSN FROM tblSection WHERE secSemester=3 AND secYear=2010 AND subCode IN ( SELECT subCode FROM tblSubject WHERE subName='Introduction to Databases')) SELECT DISTINCT stuName'Name',tblStudent.stuCode'Code',secYear'Year',subName'Subject' FROM tblStudent,tblReport,tblSection,tblSubject WHERE stuName=N'Lê Nguyễn Hoài An' AND secYear=2010 SELECT claCode'Class', COUNT(stuCode)'Number of student' FROM tblStudent GROUP BY claCode SELECT * FROM tblStudent s, (SELECT r.stuCode, COUNT (*) AS EnrollCourses FROM tblReport r, tblSection s WHERE r.secCode = s.secCode AND s.secYear=2010 GROUP BY r.stuCode ) r1, (SELECT r.stuCode, COUNT (*) AS PassedCourses FROM tblReport r, tblSection s WHERE r.secCode = s.secCode AND s.secYear=2010 AND r.repStatus= 'P' GROUP BY r.stuCode ) r2 WHERE r1.stuCode = r2.stuCode AND r1.EnrollCourses = r2.PassedCourses and r1.stuCode = s.stuCode SELECT * FROM tblStudent s, (SELECT stuCode, as avgGrade FROM tblSection WHERE sec.secYear = 2010 GROUP AVG((repTheory*1.0+repPracticle*1.0)/2) sec, tblReport rep sec.secCode = rep.secCode AND BY stuCode) R1, (SELECT claCode, MAX(avgGrade) as MaxScore FROM tblStudent stu, (SELECT stuCode, AVG((repTheory*1.0+repPracticle*1.0)/2) as avgGrade FROM tblSection sec, tblReport rep WHERE sec.secCode = rep.secCode AND sec.secYear = 2010 GROUP BY stuCode)s1 WHERE stu.stuCode = s1.stuCode GROUP BY stu.claCode) R2 WHERE s.stuCode= R1.stuCode AND s.claCode=r2.claCode AND r2.MaxScore=r1.avgGrade SELECT secCode, COUNT(*) numOfStudent FROM (SELECT t1.stuCode, t2.secCode FROM tblReport t1, (SELECT secCode FROM tblSection WHERE secYear = 2010)t2 WHERE t1.secCode = t2.secCode AND t1.repStatus = N'R') m GROUP BY secCode;