Vous êtes sur la page 1sur 3

BAI TAP - MON CSDL

BAI TAP 3

QUAN LY HOC VIEN


Mot trung tam ngoai ng muon tin hoc hoa cong tac quan ly ghi danh va ket qua hoc tap cua hoc vien, cung nh theo doi cac lp hoc, a thiet ke lc o CSDL sau: KHOAHOC(MAKH, TENKH, BD, KT) Mo ta : Moi mot khoa hoc co mot ma so (MAKH) duy nhat phan biet vi cac khoa hoc khac, co ten khoa hoc (TENKH), ngay bat au (BD) va ngay ket thuc khoa hoc (KT). HOCVIEN(MAHV, HO, TEN, NTNS, DCHI, NNGHIEP) Mo ta : Moi mot hoc vien co mot ma so (MAHV) duy nhat e phan biet vi cac hoc vien khac, co ho (HO), ten (TEN), ngay thang nam sinh (NTNS), a ch (DCHI), Nghe nghiep (NNGHIEP). GIAOVIEN(MAGV, HOTEN, NTNS, DC) Mo ta : Moi mot giao vien co mot ma so (MAGV) duy nhat e phan biet vi cac giao vien khac, co ho ten (HOTEN), ngay thang nam sinh (NTNS), a ch (DC). LOPHOC(MALOP, TENLOP, MAKH, MAGV, SISODK, LTRG,PHHOC) Mo ta: Moi mot lp hoc co mot ma so (MALH) duy nhat e phan biet vi cac lp hoc khac, co ten lp (TENLOP). Moi mot lp hoc thuoc ve mot khoa hoc duy nhat (MAKH) va do mot giao vien (MAGV) duy nhat phu trach, va co mot lp trng (LTRG). Vao au khoa hoc ngi ta d nh mot s so d kien (SISODK) cho moi lp, va mot phong hoc (PHHOC) s dung trong suot khoa hoc. BIENLAI(MAKH, MALH, MAHV, SOBL, DIEM, KQUA, XEPLOAI, TIENNOP) Mo ta : Moi hoc vien ghi danh vao mot lp (MALH) trong khoa (MAKH), se co mot so bien lai duy nhat (SOBL) trong khoa o , trong o co ghi nhan so tien hoc vien thc nop (TIENNOP). Neu hoc vien c mien hoc ph th TIENNOP= 0 hoac Null. Cuoi moi khoa hoc, moi hoc vien se co mot ket qua anh gia, bao gom: iem kiem tra (DIEM), xep loai (XEPLOAI) va ket qua au rt (KQUA). iem kiem tra c tnh tren thang 10, xep loai co 4 mc: Gioi, Kha, TB, Yeu.

Di ay la mot the hien cua CSDL tren:

BAI TAP - MON CSDL


BIENLAI MAKH PT197 PT197 PT197 PT197 PT197 PT197 PT197 PT197 PT197 PT197 PT197 PT197 PT197 PT297 PT297 PT297 PT297 PT297 PT297 PT297 PT297 PT297 PT297 PT297 PT297 PT297 PT297 PT297 PT297 PT297 MALH 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 MAHV 1 2 3 4 5 6 7 8 9 10 11 12 0 1 13 3 15 6 7 8 9 10 11 16 17 19 20 21 22 23 SOBL 1 2 3 4 5 6 7 8 9 10 11 12 34 13 14 15 17 18 19 20 21 22 23 24 25 27 28 29 30 31 DIEM 8 4 4 3 4 9 6.5 5 7 8 6 9 3 4 7 2 6 9 6.5 4.5 8 9.5 7 5 9 9 5 3 6.5 7.5 KQUA DAU XEPLOAI KHA TIENNOP 100,000 100,000 100,000 100,000 100,000 100,000 HOCVIEN 100,000 100,000 100,000 100,000 100,000 MAHV 0 1 2 3 4 100,000 100,000 100,000 100,000 5 6 7 8 9 100,000 10 11 100,000 100,000 100,000 100,000 100,000 100,000 100,000 100,000 100,000 100,000 12 13 15 16 17 19 20 21 22 23 HO Ho Thanh Tran Tam Do Nghiem Tran Nam Nguyen Tien Mai Thanh Tran Doan Nguyen Manh Tran Van Nguyen Thi Khanh Tran Dinh Le Le thi Gia Nguyen Thi Kim Nguyen Thi Tuyet Nguyen Thi Hong Nguyen Thi Kim Nguyen Thi Kim Nguyen Tuong Nguyen Thi Ngoc Tran Thi Khanh Nguyen Ha Nguyen Thi Kim TEN Son Thanh Phung Son Dung Nam Hung Hung Tien Van Huong Tran Cuong Anh Loan Thoa Mai Lan Mai Tuong Thao Ngan NTNS 01-01-68 04-03-60 12-01-79 03-08-80 04-03-69 02-08-76 19-01-68 29-01-67 03-02-79 03-04-59 07-03-70 19-03-68 28-05-69 02-04-68 06-03-70 20-02-71 07-02-69 30-09-71 12-12-56 02-03-70 19-03-73 04-03-69 DC 209 Tran Hung Dao Q5 109/2 CMTT F10 QTB 34 Do Duy Duong Q5 190/2A Ho Tung Mau Q1 23/8 Thai Van Lung Q1 12 DBP Q1 189 Tran Van Bo Q4 68 Nguyen Thien Thuat Q3 18 Le Duan Q1 48/3 Ho Tung Mau Q1 44A Cu xa Tu Do F4 QTB 34 Ly Thuong Kiet QTB 356/2F Ly Thuong Kiet QTB 789 Phan Dang Luu QBT 567/23 XVNT P25 QBT 34 Thala Tan Bien Tay Ninh 78 XVNT QBT 456 CNTT F13 QTB 124 Nguyen Duy Duong Q5 24 Ly thuong Kiet QTB 56 Bui Dinh Tuy QTB 178 Vo T. Trang F11 QTB NNGHIEP Bac si Giao vien Hoc sinh Hoc sinh Giao vien Cong nhan Giao vien Dien vien Tho may Noi tro Nguoi mau Giao vien Tho may Ban hang Nguoi mau Ban hang Tho may Sinh vien Ban hang Bac si Ky su Tho uon toc GIAOVIEN MAGV 1 2 3 4 5 HOTEN Tran Thanh Nguyen Nam Ho Nhan Duong Hung Le Thuong NTNS 02-01-59 04-02-60 04-03-60 03-03-58 07-05-65 DC 12/4 Tran B.Trong Q1 30 Dien Bien Phu Q1 123 Ho Quy Cap Q1 23 Hai Ba Trung 61/4 Huynh Man Dat

KHONG DAU YEU KHONG DAU YEU KHONG DAU YEU KHONG DAU YEU DAU DAU DAU DAU DAU DAU DAU GIOI TB TB KHA KHA TB GIOI

KHONG DAU YEU KHONG DAU YEU DAU GIOI

KHONG DAU YEU DAU DAU DAU TB GIOI TB

KHONG DAU YEU DAU DAU DAU DAU DAU DAU DAU KHA GIOI KHA TB GIOI GIOI TB

KHONG DAU YEU DAU DAU TB KHA

BAI TAP - MON CSDL


KHOAHOC MAKH PT197 PT297 CT297 TENKH Tieng Phap pho Thong khoa 1/97 Tieng Phap pho thong khoa 2/97 Tieng Phap chuyen tu khoa 2/97 BD 15-02-97 30-05-97 30-05-97 KT 15-05-97 30-08-97 30-08-97 LOPHOC MALOP 1 2 3 4 TENLOP Tieng Phap pho Thong 1.1 Tieng Phap pho Thong 2.1 Tieng Phap pho Thong 1.2 Tieng Phap chuyen tu A MAKH PT197 PT297 PT297 CT297 MAGV 1 2 3 4 SISODK 10 10 20 15 LTRG 9 6 17 PHHOC 101 201 202 203

Cac yeu cau: A. Xac nh khoa chnh, khoa ngoai cua lc o quan he cho CSDL tren. B. Cai at CSDL tren tren mot He QTCSDL cu the: Access, MS SQL Server, C. Xay dng cac truy van sau ay bang ngon ng SQL: 1. Cho biet ket qua cuoi khoa (iem, ket qua, xep loai ) cua cac hoc vien do giao vien Tran Thanh hoac "Ho Nhan"day trong khoa co ma so PT197. 2. Cho biet danh sach lp hoc va so lng hoc vien thc s cua lp o 3. Cho biet ho ten, NTNS, a ch cua hoc vien co iem cao nhat trong khoa co ma so PT297 4. Cho biet ten cac lp hoc va iem trung bnh, iem cao nhat cua tat ca cac hoc vien trong lp. 5. Cho biet ten lp hoc va lng so hoc vien xep loai kha hoac gioi trong lp o. 6. Cho biet ho ten nhng hoc vien, ten lp hoc ma hoc vien o theo hoc va so bien lai tng ng, cac lp nay phai thuoc ve cac khoa hoc ket thuc trc 30/5/97. 7. Cho biet ten nhng lp hoc co s so thc s vt s so d kien. 8. Cho biet ten va ma so cac lp hoc co s so thc s t nhat. 9. Cho biet ho ten, a ch cua nhng hoc vien la giao vien ong thi la lp trng. 10. Cho ho ten giao vien va so lng lp ma giao vien o a day. 11. Cho biet ho ten va ket qua hoc tap (iem, xep loai, ket qua ) cua nhng hoc vien c mien hoc ph. 12. Cho ten cac khoa hoc va so lng cac lp hoc trong khoa. 13. Cho biet cac ten lp hoc, ten giao vien phu trach, s so d kien cua lp va phong hoc cua cac lp hoc ang dien ra vao ngay 17/4/97. 14. Cho biet ho ten va ket qua hoc tap cua nhng hoc vien lp trng cua tng lp 15. Cho biet ten lp hoc va lng so hoc vien "khong au", so lng hoc vien xep loai trung bnh hoac yeu trong lp o. 16. Cho biet ma so va ho ten nhng hoc vien lai lp t nhat 1 lan. 17. Cho biet cac hoc vien co Ho "Nguyen" 18. Cho biet cac hoc vien hoc tat ca cac khoa "Tieng Phap pho thong" m vao nam 1997. 19. Cho biet cac hoc vien luon luon xep loai GIOI trong tat ca cac khoa theo hoc. 20. Cho biet 3 so bien lai cua khoa "PT197" co iem xep cao nhat.