0% found this document useful (0 votes)
14 views42 pages

Database Final Report Team 3 1

Uploaded by

ngthuthuy1110
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views42 pages

Database Final Report Team 3 1

Uploaded by

ngthuthuy1110
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

MINISTRY OF EDUCATION AND TRAINING

INTERNATIONAL SCHOOL –
VIETNAM NATIONAL UNIVERSITY, HANOI
FACULTY OF APPLIED SCIENCES


Designing database in teaching at International School –


Hanoi National University

Lecturer :MSc Do Tien Thanh


Students :22070347 - Tran Ngoc Thien Thanh(Leader)
22071150 - Vu Duc Thanh
22071171 - Vuong Thinh
Section class :ISV2016 - ISV201604

Hanoi, December 13th 2023


INTRODUCTION
The database plays an indispensable role in the management and operation of the
International School - Hanoi National University. Designing a database of student,
lecturer, and course information helps schools manage more effectively. Information
about students including name, date of birth, hometown, study program, scores... is
stored scientifically, helping to look up information quickly and accurately. The
database of lecturers includes names, subjects, courses being taught, published articles...
helping the school manage teaching and scientific research. The database of courses
includes course names, instructors, number of credits, and subject content... helping
students choose courses that suit their needs and interests.
Besides, the database also collects information about extracurricular activities, clubs,
and events... to help students fully participate in activities and develop
comprehensively. With a modern database system, the International School - Hanoi
National University has created a modern, quality learning environment, meeting the
increasing needs of students in the 4.0 era."

1
CHAPTER I: BUSINESS DESCRIPTION
A, Short description
1, General description of the university
The International School at Vietnam National University, Hanoi (VNU-IS) is not just a
training unit with its own identity and values, but also a place that connects the East and
West, attracting prestigious experts, scientists, and excellent students for study and
research. The school contributes to society and the community by training high-quality
human resources to meet the needs of domestic and international labor markets.
VNU-IS carries out its mission under three pillars:
• Creating new knowledge, transferring knowledge and skills to learners, serving
society, and contributing to the country’s development.
• Successfully completing the tasks assigned by VNUHN.
• Financial autonomy.

Over 20 years of operation, the school has developed 15 undergraduate training


programs and 6 graduate training programs with various training methods. All training
programs are delivered in foreign languages with the ratio of international lecturers
participating in teaching in each program ranging from 30% to 70%. The training scale
of the school is more than 6,000 undergraduate and graduate students. Nearly 20,000
students have graduated from undergraduate courses and programs with a job placement
rate of over 93% within one year of graduation. The school’s graduate training system
has nearly 700 masters graduated from 17 cohorts of master’s programs.
In the context of the 4.0 industrial revolution, the design and use of databases have
become extremely important. Databases help the school manage information about
students, lecturers, training programs, courses, scores, extracurricular activities…
scientifically and effectively. This not only helps the school grasp its operational
situation but also helps students and lecturers access information quickly and accurately.
Moreover, the use of databases also helps the school analyze and evaluate the quality of
training, thereby proposing measures to improve and enhance the quality of training.
Therefore, the design and use of databases are an important factor contributing to the
success of The International School - Vietnam National University, Hanoi.
2, Effectiveness of the database management system of the international school -
Vietnam National University, Hanoi.
The Student Database Management System at the International School - Vietnam
National University, Hanoi, has been designed to offer a holistic perspective to the
board of directors on the administration of student affairs. This system facilitates the
registration of courses each semester, enabling students to select instructors based on
the information provided by the system. Furthermore, it allows students to evaluate their
eligibility for scholarships each semester, once their examination results are released.

2
The system also provides insights into the functioning and interdepartmental
interactions within the institution, along with comprehensive departmental information.
Engineered for optimal performance, this system ensures smooth and logical operations.
It is capable of securely storing extensive information about students, departments, and
courses, as well as master’s and doctoral programs. This robust system underscores our
commitment to maintaining the highest standards of academic and professional
excellence. This system includes:
1. Student records management system.
2. Curriculum management system.
3. Lecturer profile management system.
4. The system allocates classes and subjects
3. Entities
This database management system consists of 8 tables: Result, Student, Award,
Lecturer, Faculty, Class, Major, and Subject. Each table has a primary key (PK) and
some have foreign keys (FK) that link to other tables. The tables are related as follows:
- The Result table stores the information about the results of the exams taken by the
student. Return learning results and assessments to students.
* Components in the table:
+ Students code (PK1, FK1)
+ Subjects code (PK2, FK2)
+ Exam times (FK)
+ Average score semester 1
+ Average score semester 2
+ Academic year
- The Student table stores the information about the students who are enrolled in the
faculty. Receiving students' results after exams, they can be used in considering
scholarships.
* Components in the table:
+ Student code (PK)
+ Full name
+ Birthdate
+ S_Ethnicity
+ S_Address
+ Class code (FK)
+ Sex
+ Faculty code (FK)
+ Major code (FK)

3
- The Award table stores the information about the awards or scholarships given to the
students.
* Components in the table:
+ Award code (PK)
+ Student code (FK)
+ Scholarship
- The Lecturer table stores the information about the lecturers who teach in the faculty.
* Components in the table:
+Lecture code (PK)
+ Faculty code (FK)
+ Email
+ Degree
+ Sex
+ Full name
+L_Ethinicity
+L_Address
- The Faculty table stores the information about the faculties in the university. It is the
place to manage lecturers, and students and run academic programs.
* Components in the table:
+Faculty code (PK)
+Faculty name
+Founded year
- The Class table stores the information about the classes or groups of students who
study the same major.
* Components in the table:
+ Class code (PK)
+ Major code (FK)
+ Faculty code (FK)
+ Class name
- The Major table stores the information about the majors or programs offered by the
faculty.
* Components in the table:
+ Major code (PK)
+ Major name
+ Faculty name (FK)
+ Program name
- The Subject table stores the information about the subjects or courses taught by the
lecturers.

4
* Components in the table:
+ Subject code (PK)
+ Major code (FK)
+ Subject name.
B. Designing Diagram
I. ERD

II. Relation Schema


1. TABLE FACULTY
Attribute Data Type Primary Foreign Constraint
Faculty code char(10) x
Faculty name varchar(100) DEFAULT NULL
Founded year int

2. TABLE MAJOR
Attribute Data Type Primary Foreign Constraint
Major code varchar(50) x NOT NULL
Faculty code varchar(10) Faculty(Faculty codde) NOT NULL
Major name varchar(50)
Program name varchar(50)

5
3. TABLE CLASS
Attribute Data Type Primary Foreign Constraint
Classcode varchar(10) x NOT NULL
Major code varchar(50) MAJOR (Major code) NOT NULL
Faculty code varchar(10) FACULTY (Faculty code) NOT NULL
Class name varchar(50)

4. TABLE SUBJECTS
Attribute Data Type Primary Foreign Constraint
Subjects code char(10) x NOT NULL
Faculty code varchar(100) x
Course name char(10) FACULTY (Faculty code) NOT NULL
Credit hours int

5. TABLE STUDENTS
Attribute Data Type Primary Foreign Constraint
Student code char(10) x NOT NULL
Full name varchar(50)
Birthdate date NOT NULL
Class code varchar(10) CLASS (Class code) NOT NULL
Sex char(10) Sex IN ('M', 'F', 'm', 'f')
S_Address varchar(50) DEFAULT NULL
S_Ethnicity vachar(50) DEFAULT NULL
Major code vachar(50) MAJOR (Major code) NOT NULL
Faculty code varchar(10) FACULTY(Faculty code) NOT NULL

6. TABLE RESULT
Attribute Data Type Primary Foreign Constraint
Student code char(10) x Student (Students code) NOT NULL
Subjects code char(10) x Subjects (Subjects code) NOT NULL
Exam times int x NOT NULL
Average score semester 1 decimal(4,2) DEFAULT NULL
Average score semester 2 decimal(4,2) DEFAULT NULL
Average score acedamic year decimal(4,2) DEFAULT NULL

6
7. TABLE LECTURER
Attribute Data Type Primary Foreign Constraint
Lecturer code char(10) x NOT NULL
Faculty code varchar(10) FACULTY(Faculty code) NOT NULL
Sex char(10) Sex IN ('M', 'F', 'm', 'f')
Email varchar(50) DEFAULT NULL
Degree varchar(50) DEFAULT NULL
Fullname varchar(100) NOT NULL
L_Ethnicity varchar(50) DEFAULT NULL

8. TABLE AWARDS
Attribute Data Type Primary Foreign Constraint
Awards code char(10) x
Student code char(10) Student (Student code) NOT NULL
Scholarship float

III. DATA
1. TABLE FACULTY
Faculty code Faculty name Founded year
FC001 Faculty of Applied Sciences 2002
FC002 Faculty of Economics and Management 2004
FC003 Faculty of Applied Linguistics 2006

2. TABLE AWARDS
Award code Student code Scholarship
AW001 S013 $1000
AW002 S038 $1500
AW003 S003 $1200
AW004 S004 $1100
AW005 S005 $1300
AW006 S034 $1400
AW007 S027 $1250
AW008 S016 $1350
AW009 S050 $1800
AW010 S046 $1700

7
3. TABLE LECTURER

Full name Lecturer Sex Degree Email Faculty Ethinicity Phone


code code Number

Chu Đình Tới LC01 F TS [email protected] FC003 Kinh 0914770557

Trần Thị Oanh LC02 M PGS.T [email protected] FC003 Kinh 0777614886


S u.vn

Lê Đức Thịnh LC03 F TS [email protected] FC001 Kinh 0373890387

Trương Công Đoàn LC04 F TS [email protected] FC001 Kinh 0962015958


n

Nguyễn Doãn Đông LC05 F TS [email protected] FC001 Kinh 0828860744

Trần Anh Hào LC06 F TS [email protected] FC001 Kinh 0911443322

Lê Xuân Hải LC07 F TS [email protected] FC003 Kinh 0832906988

Phạm Thị Việt Hương LC08 M TS [email protected]. FC002 Kinh 0828466160


vn

Nguyễn Ngọc Linh LC09 F TS [email protected]. FC002 Kinh 0912443076


vn

Trần Đức Quỳnh LC010 M TS [email protected]. FC002 Kinh 0912112446


vn

Kim Đình Thái LC011 M TS [email protected] FC002 Kinh 0912898020

Nguyễn Hải Thanh LC012 M PGS.T [email protected] FC002 Kinh 0347378888


S. n

Lê Trung Thành LC013 M PGS.T [email protected] FC002 Kinh 0906052779


S n

Nguyễn Quang Thuận LC014 M TS nguyenquangthuan FC002 Kinh 0946683886


@vnu.edu.vn

8
Lê Duy Tiến LC015 M ThS [email protected]. FC002 Thái 0834944888
vn

Bùi Thanh Tùng LC016 M ThS [email protected] FC002 Kinh 0932203045


du.vn

Nguyễn Thanh Tùng LC017 M PGS.T [email protected] FC003 Kinh 0919852297


S

Nguyễn Văn Tính LC018 M TS [email protected] FC003 Kinh 0982956917

Phạm Hải Yến LC019 F ThS [email protected] FC001 Kinh 0856791953

Nguyễn Văn Tánh LC020 M TS [email protected] FC001 Kinh 0848098368

Nguyễn Anh Tuấn LC021 M ThS [email protected] FC003 Mường 0948402875


n

Vũ Thị Huệ LC022 F ThS [email protected] FC003 Kinh 0917367263

Bùi Nhật Lệ LC023 F Ths [email protected] FC001 Kinh 0915937817

Nguyễn Quỳnh Hương LC024 F ThS nguyenquynhhuong FC001 Kinh 0942751963


@vnu.edu.vn

Vũ Ngọc Mai LC025 F Ths [email protected] FC002 Kinh 0932247581


n

Thân Văn Thái LC026 M TS [email protected] FC002 Kinh 0946516204

Hà Mạnh Hùng LC027 M TS [email protected]. FC002 Kinh 0947134328


vn

Nguyễn Đăng Khoa LC028 M TS [email protected]. FC002 Kinh 0933755868


vn

Phạm Ngọc Thành LC029 M TS [email protected] FC002 Kinh 0914361239


n

Trần Thị Ngân LC030 F PGS. [email protected] FC002 Kinh 0836830866


TS n

9
4. TABLE CLASS

Class code Faculty code Major code Class name


ICE01 FC001 ICE C1
BDA01 FC001 BDA C2
MIS01 FC001 MIS C3
AI01 FC001 AI C4
AIT01 FC001 AIT C5
FDB01 FC001 FDB C6
ISEL01 FC001 ISEL C7
IB01 FC002 IB C8
AAA01 FC002 AAA C9
HSTM01 FC002 HSTM C10
MGT01 FC002 MGT C11
MKT01 FC002 MKT C12
IBFI01 FC002 IBFI C13
FM01 FC002 FM C14
BA01 FC002 BA C15
MRO01 FC002 MRO C16
BEL01 FC003 BEL C17

10
5. TABLE MAJOR

Major Faculty Major name Program name


code code
ICE FC001 Informatics and Computer Engineering Doctoral program
BDA FC001 Business Data Analytics Master’s program
MIS FC001 Management Information System Doctoral program
AI FC001 Automation and Informatics Exchange program
AIT FC001 Applied Information Technology Combined Bachelors and Masters degree
FDB FC001 Finacial Technology and Digital Business Combined Bachelors and Masters degree
ISEL FC001 Industrial Engineering and Logistics Systems Combined Bachelors and Masters degree
IB FC002 International Business Undergraduate program
AAA FC002 Accounting, Analysis and Auditing Undergraduate program
HSTM FC002 Hospitality, Sports and Tourism Management Undergraduate program
MGT FC002 Management Dual degree
MKT FC002 Marketing Dual degree
IBFI FC002 International Banking, Finance and Insurance Collaborative
FM FC002 Finacial Management Undergraduate program
BA FC002 Bussiness Administration Undergraduate program
MRO FC002 Makerting Research and Operation Undergraduate program
BEL FC003 Bachelor of English Language Undergraduate program

11
6. TABLE SUBJECTS

Subjects code Subjects name Major code


SE01 Software Engineering ICE
PS02 Probability and Statistics BDA
ACS03 Applied Computer Science MIS
HCI04 Human computer interactiom AI
BF05 Basic Finance AIT
AP06 Accounting Principles FDB
QE07 Quantitative Economics ISEL
IE08 International Economics IB
OOP09 Object-Oriented Programming AAA
BOM010 Business Organization and Management HSTM
ISP011 Information Security Principles MGT
IF012 International Finance MKT
EC013 E-Commerce IBFI
BIS014 Banking Information Systems FM
BAM015 Business Administration BA
MKT016 Marketing MRO
BC017 Blockchain and Cryptoccurency BEL
DM018 Discrete Mathematics ICE
EA019 Economics Analysis BDA
D020 Database MIS
ML021 Machine learning AI
DS022 Data Science AIT
BC023 Blockchain and Cryptoccurency FDB
LS024 Logistics Science ISEL
E025 Enviromental Economics IB
BDA026 Big Data Analysis AAA
WD027 Web Development HSTM
PE028 Public Economics IB
MAD029 Moblie app Development FDB
OOP030 Object-Oriented Programming AI

12
7. TABLE STUDENTS

Student Faculty Class Major


code code code code Full name Birth date Ethnicity Gender Hometown
S001 FC001 ICE01 ICE John Smith 1998-05-12 Caucasian Male New York, USA
S002 FC001 BDA01 BDA Emily Johnson 1999-09-18 Asian Female Los Angeles, USA
S003 FC001 MIS01 MIS Michael Williams 1997-03-25 African Male Chicago, USA
S004 FC001 AI01 AI Sophia Brown 2000-11-08 Hispanic Female Miami, USA
S005 FC001 AIT01 AIT Daniel Lee 1996-07-30 Caucasian Male Houston, USA
S006 FC001 FDB01 FDB Olivia Garcia 1998-12-03 Hispanic Female Phoenix, USA
S007 FC001 ISEL01 ISEL William Martinez 1999-04-16 Asian Male Philadelphia, USA
S008 FC002 IB01 IB Emma Rodriguez 1997-10-22 Caucasian Female San Antonio, USA
S009 FC002 AAA01 AAA Liam Nguyen 2001-02-09 Asian Male San Diego, USA
S010 FC002 HSTM01 HSTM Ava Hernandez 1999-06-14 Hispanic Female Dallas, USA
S011 FC002 MGT01 MGT Ethan Kim 1998-08-27 Asian Male San Jose, USA
S012 FC002 MKT01 MKT Mia Patel 2000-01-31 Asian Female Austin, USA
S013 FC002 IBFI01 IBFI Alexander Smith 1997-11-19 Caucasian Male Jacksonville, USA
S014 FC002 FM01 FM Isabella Wilson 1999-03-05 African Female Columbus, USA
S015 FC002 BA01 BA James Brown 1998-09-10 Caucasian Male Charlotte, USA
S016 FC002 MRO01 MRO Evelyn Nguyen 2000-04-28 Asian Female San Francisco, USA
S017 FC003 BEL01 BEL Benjamin Garcia 1996-12-12 Hispanic Male Indianapolis, USA
S018 FC001 ICE01 ICE Charlotte Kim 2001-08-03 Asian Female Seattle, USA
S019 FC001 BDA01 BDA Noah Miller 1997-02-17 Caucasian Male Denver, USA
S020 FC001 MIS01 MIS Amelia Gonzalez 1999-07-20 Hispanic Female Washington, USA
S021 FC001 AI01 AI Emily Johnson 1998-03-15 Caucasian Female New York, USA
S022 FC001 AIT01 AIT Daniel Lee 1999-07-22 Asian Male Los Angeles, USA
S023 FC001 FDB01 FDB Sophia Brown 2000-11-10 Hispanic Female Chicago, USA
S024 FC001 ISEL01 ISEL William Martinez 1997-01-05 Hispanic Male Miami, USA
S025 FC002 IB01 IB Olivia Garcia 1998-08-20 Caucasian Female Houston, USA
S026 FC002 AAA01 AAA Mia Patel 2001-04-18 Asian Female Phoenix, USA
S027 FC002 HSTM01 HSTM Ethan Kim 1999-09-30 Asian Male Philadelphia, USA
S028 FC002 MGT01 MGT Emma Rodriguez 1998-05-12 Hispanic Female San Antonio, USA

13
Student Faculty Class Major
code code code code Full name Birth date Ethnicity Gender Hometown
S029 FC002 MKT01 MKT Liam Nguyen 2001-10-28 Asian Male San Diego, USA
S030 FC002 IBFI01 IBFI Ava Hernandez 1997-12-03 Hispanic Female Dallas, USA
S031 FC002 FM01 FM Alexander Smith 2000-06-14 Caucasian Male San Jose, USA
S032 FC002 BA01 BA Isabella Wilson 1998-02-09 African Female Austin, USA
S033 FC002 MRO01 MRO James Brown 1999-07-17 Caucasian Male Jacksonville, USA
S034 FC003 BEL01 BEL Evelyn Nguyen 1997-04-28 Asian Female Columbus, USA
S035 FC001 ICE01 ICE Benjamin Garcia 2001-09-22 Hispanic Male Charlotte, USA
S036 FC001 BDA01 BDA Charlotte Kim 1998-11-19 Asian Female San Francisco, USA
S037 FC001 MIS01 MIS Noah Miller 2000-03-07 Caucasian Male Indianapolis, USA
S038 FC001 AI01 AI Amelia Gonzalez 1999-05-25 Hispanic Female Seattle, USA
S039 FC001 AIT01 AIT Grace Lee 1998-08-12 Asian Female Denver, USA
S040 FC001 FDB01 FDB Samuel Thompson 2001-12-30 Caucasian Male Washington, USA
S041 FC001 ISEL01 ISEL Lily Davis 1997-06-25 African Female Boston, USA
S042 FC002 IB01 IB Jacob Martinez 1999-10-03 Hispanic Male Atlanta, USA
S043 FC002 AAA01 AAA Mia Robinson 2000-04-18 Caucasian Female Detroit, USA
S044 FC002 HSTM01 HSTM Lucas White 1998-09-05 Asian Male Memphis, USA
S045 FC002 MGT01 MGT Zoey Nguyen 1997-02-15 Hispanic Female Portland, USA
S046 FC002 MKT01 MKT Elijah Rodriguez 2001-07-20 Caucasian Male Nashville, USA
S047 FC002 IBFI01 IBFI Avery Brown 1998-11-03 African Female Las Vegas, USA
S048 FC002 FM01 FM Jayden Kim 1999-05-28 Asian Male Louisville, USA
S049 FC002 BA01 BA Harper Garcia 2000-08-12 Hispanic Female Baltimore, USA
S050 FC002 MRO01 MRO Addison Nguyen 1997-12-30 Caucasian Male Milwaukee, USA

14
8. TABLE RESULT

Student Subjects Exam


code code times Avg. score sem. 1 Avg. score sem. 2 Avg. score academic year
S001 SE01 1 8.5 8.8 8.7
S002 PS02 1 5.6 4.9 5.3
S003 ACS03 1 9.0 9.2 9.1
S004 HCI04 1 8.7 8.9 8.8
S005 BF05 1 7.5 8.0 7.8
S006 AP06 2 8.2 8.5 8.4
S007 QE07 1 9.1 9.3 9.2
S008 IE08 1 3.5 5.5 4.5
S009 OOP09 1 4.9 6.7 5.8
S010 BOM010 1 8.6 8.8 8.7
S011 ISP011 2 8.3 8.7 8.5
S012 IF012 1 2.5 4.5 3.5
S013 EC013 1 9.2 9.0 9.1
S014 BIS014 1 8.5 8.7 8.6
S015 BAM015 2 3.7 7.6 5.7
S016 MKT016 1 8.9 9.1 9.0
S017 BC017 1 7.8 8.2 8.0
S018 DM018 2 8.5 8.8 8.7
S019 EA019 1 5.8 6.0 5.9
S020 D020 1 8.5 8.7 8.6
S021 ML021 2 8.7 9.0 8.9
S022 DS022 1 3.5 7.5 5.5
S023 BC023 1 8.8 9.1 9.0
S024 LS024 2 9.0 9.2 9.1
S025 E025 2 4.6 5.1 4,9
S026 BDA026 1 8.6 8.8 8.7
S027 WD027 1 5.5 3.5 4.5
S028 PE028 1 8.8 9.1 9.0

15
Student Subjects Exam
code code times Avg. score sem. 1 Avg. score sem. 2 Avg. score academic year
S029 MAD029 1 8.2 8.6 8.4
S030 OOP030 1 7.9 8.2 8.1
S031 SE01 1 8.9 92 9.1
S032 PS02 1 8.5 8.8 8.7
S033 ACS03 2 2.5 5.5 4.0
S034 HCI04 1 3.5 3.8 3,7
S035 BF05 1 8.7 8.9 8.8
S036 AP06 1 3.5 4.2 3.9
S037 QE07 2 8.2 8.5 8.4
S038 IE08 1 9.1 9.3 9.2
S039 OOP09 1 8.8 9.0 8.9
S040 BOM010 2 6.1 7.4 6.3
S041 ISP011 1 8.6 8.8 8.7
S042 IF012 1 8.3 8.7 8.5
S043 EC013 1 4.5 7.5 6.0
S044 BIS014 2 5.9 6.9 6.4
S045 BAM015 1 8.5 8.7 8.6
S046 MKT016 1 9.2 9.4 9.3
S047 BC017 2 8.9 9.1 9.0
S048 DM018 1 7.8 8.2 8.0
S049 EA019 1 8.5 8.8 8.7
S050 D020 1 9.3 9.5 9.4

16
CHAPTER 2: SQL STATEMENT
A. Tạo bảng
1. TABLE: FACULTY
CREATE TABLE FACULTY (
Faculty_code VARCHAR(10) PRIMARY KEY,
Faculty_name VARCHAR(100) DEFAULT NULL,
Founded_year INT);

2. TABLE MAJOR
CREATE TABLE MAJOR (
Major_code VARCHAR(50) NOT NULL PRIMARY KEY,
Major_name VARCHAR(50),
Faculty_code VARCHAR(10) NOT NULL,
Program_names VARCHAR(50)
FOREIGN KEY(Faculty_code) REFERENCES FACULTY(Faculty_code) ON DELETE
CASCADE ON UPDATE CASCADE);

17
3. TABLE: SUBJECTS
CREATE TABLE SUBJECTS (
Subjects_code CHAR(10) PRIMARY KEY,
Subjects_name CHAR(50) NOT NULL ,
Major_code VARCHAR(50) NOT NULL,
FOREIGN KEY(Major_code) REFERENCES MAJOR(Major_code) ON DELETE CASCADE
ON UPDATE CASCADE);

4. TABLE: CLASS
CREATE TABLE CLASS (
Class_code VARCHAR(10) NOT NULL PRIMARY KEY,
Faculty_code VARCHAR(10) NOT NULL,
Major_code VARCHAR(50) NOT NULL,
Class_name VARCHAR(50)
FOREIGN KEY(Faculty_code) REFERENCES FACULTY(Faculty_code) ON DELETE
CASCADE ON UPDATE CASCADE,
FOREIGN KEY(Major_code) REFERENCES MAJOR(Major_code) );

18
5. TABLE: LECTURER
CREATE TABLE LECTURER(
Lecturer_code CHAR(10) PRIMARY KEY,
Email VARCHAR(50) DEFAULT NULL,
Sex CHAR(10) CHECK (Sex IN ('M', 'F', 'm', 'f')),
Full_name VARCHAR(100) NOT NULL,
Degree VARCHAR(50) DEFAULT NULL,
Faculty_code VARCHAR(10) NOT NULL,
L_Ethnicity VARCHAR (50) DEFAULT NULL,
Phone_number INT DEFAULT NULL,
FOREIGN KEY(Faculty_code) REFERENCES FACULTY(Faculty_code) ON
DELETE CASCADE ON UPDATE CASCADE);

6. TABLE: STUDENTS
CREATE TABLE STUDENTS (
Student_code CHAR(10) NOT NULL PRIMARY KEY ,
Full_name VARCHAR(50) NOT NULL,
Birthdate DATE NOT NULL,
Sex CHAR(10) CHECK (Sex IN ('Male', 'Female', 'male', 'female')),
S_Address VARCHAR(50) DEFAULT NULL,
S_Ethnicity VARCHAR(50) DEFAULT NULL,
Class_code VARCHAR(10) NOT NULL,
Major_code VARCHAR(50) NOT NULL,
Faculty_code VARCHAR(10)
FOREIGN KEY(Class_code) REFERENCES CLASS(Class_code) ON DELETE CASCADE
ON UPDATE CASCADE,
FOREIGN KEY(Faculty_code) REFERENCES FACULTY(Faculty_code),
FOREIGN KEY(Major_code) REFERENCES MAJOR(Major_code) );

19
7. RESULT
CREATE TABLE RESULT (
Student_code CHAR(10) NOT NULL,
Subjects_code CHAR(10) NOT NULL,
Exam_times INT NOT NULL,
Average_score_semester_1 DECIMAL(4,2) DEFAULT NULL,
Average_score_semester_2 DECIMAL(4,2) DEFAULT NULL,
Average_score_academic_year DECIMAL(4,2) DEFAULT NULL,
PRIMARY KEY(Student_code,Subjects_code,Exam_times),
FOREIGN KEY(Student_code) REFERENCES STUDENTS(Student_code) ,
FOREIGN KEY(Subjects_code) REFERENCES SUBJECTS(Subjects_code) );

20
8. TABLE: AWARDS
CREATE TABLE AWARDS (
Award_code CHAR(10) NOT NULL PRIMARY KEY ,
Student_code CHAR(10) NOT NULL,
Scholarship VARCHAR(10),
FOREIGN KEY(Student_code) REFERENCES STUDENTS(Student_code) ON
DELETE CASCADE ON UPDATE CASCADE,);

B. DATA RETRIVIAL QUESTION


Question 1: List students code of students who has average acedamic year >8
SELECT Student_code, Average_score_academic_year
FROM RESULT
WHERE Average_score_academic_year > 8;

21
Question 2: Retrieve information of students and their respective courses based on
their birthdate (e.gstudents born in the year 2000)
SELECT STUDENTS.*,
SUBJECTS.Subjects_name
FROM STUDENTS
JOIN SUBJECTS ON STUDENTS.Major_code = SUBJECTS.Major_code
WHERE YEAR(STUDENTS.Birthdate) = 2000;

Question 3: The statistical summary of the total number of lecturers.


SELECT
COUNT(*) AS Total_Lecturers
FROM LECTURER;

22
Question 4: Retrieve the top three students with the highest average scores for the
academic
SELECT
Student_code,
Average_score_academic_year
FROM (
SELECT Student_code, Average_score_academic_year,
ROW_NUMBER() OVER (ORDER BY Average_score_academic_year DESC) AS rank
FROM RESULT
) ranked
WHERE rank <= 3

Question 5 : Retrieve the list of students and their scholarship information by faculty
SELECT
STUDENTS.Full_name AS Student_Name,
FACULTY.Faculty_Name,
AWARDS.Scholarship
FROM STUDENTS
JOIN MAJOR ON STUDENTS.Major_code =MAJOR.Major_code
JOIN FACULTY ON MAJOR.Faculty_code =FACULTY.Faculty_code
LEFT JOIN AWARDS ON STUDENTS.Student_code =AWARDS.Student_code;)

23
Question 6: Retrieve students along with their average scores for each exam time
SELECT STUDENTS.Full_name AS Student_Name,
RESULT.Exam_times,
AVG(RESULT.Average_score_semester_1) AS Avg_Score_Semester_1,
AVG(RESULT.Average_score_semester_2) AS Avg_Score_Semester_2,
AVG(RESULT.Average_score_academic_year) AS Avg_Score_Academic_Year
FROM STUDENTS
JOIN RESULT ON STUDENTS.Student_code = RESULT.student_code
GROUP BY STUDENTS.Full_name, RESULT.Exam_times;

Question 7: Retrieve information about students and their scholarships by Faculty of


Applied Sciences
SELECT
STUDENTS.Full_name AS Student_Name,
AWARDS.Scholarship
FROM STUDENTS
JOIN MAJOR ON STUDENTS.Major_code = MAJOR.Major_code
JOIN FACULTY ON MAJOR.Faculty_code = FACULTY.Faculty_code
LEFT JOIN AWARDS ON STUDENTS.Student_code = AWARDS.Student_code
WHERE FACULTY.Faculty_name = 'Faculty of Applied Sciences';

24
Question 8: Calculates the average score, and then filters only those students whose
average academic score >7 and <8.
SELECT
Student_code,
AVG(Average_score_academic_year) AS Avg_Academic_Score
FROM RESULT
GROUP BY Student_code
HAVING AVG(Average_score_academic_year) > 7 and AVG(Average_score_academic_year)
<=8 ;

25
Question 9: Create function named udfScoreLevel – if Average_score_academic_year
< 5 , ScoreLevel= ‘Low’, Average_score_academic_year >= 5, < 8, ScoreLevel =
‘Medium’; >=8 salarylevel = ‘High’. Show table include Fullname,
Average_score_academic_year, ScoreLevel.
CREATE FUNCTION udfScoreLevel(@Average_score_academic_year DECIMAL(4,2))
RETURNS VARCHAR (10)
AS
BEGIN
DECLARE @ScoreLevel VARCHAR(10)
IF @Average_score_academic_year <5
SET @ScoreLevel='Low'
ELSE IF @Average_score_academic_year >=5 AND
@Average_score_academic_year <8
SET @ScoreLevel='Medium'
ELSE
SET @ScoreLevel='High'
RETURN @ScoreLevel
END

SELECT STUDENTS.Full_name,
RESULT.Average_score_academic_year,
dbo.udfScoreLevel(Average_score_academic_year)AS ScoreLevel
FROM STUDENTS
JOIN RESULT ON STUDENTS.Student_code = RESULT.Student_code
GROUP BY STUDENTS.Full_name,RESULT.Average_score_academic_year;

26
Question 10: Create procedure update information of students. Show Fullname, Sex,
Birth date, S_address.
CREATE PROCEDURE sinhvien_update
@Student_code CHAR(10),
@Sex CHAR(10),
@Full_name VARCHAR(50),
@Birthdate DATE,
@S_Address VARCHAR(50),
@S_Ethnicity VARCHAR(50)
AS
BEGIN UPDATE STUDENTS
SET
Student_code=@Student_code,
Full_name=@Full_name,
Birthdate=@Birthdate,
@Sex=@Sex,
S_Address=@S_Address,
S_Ethnicity=@S_Ethnicity
WHERE Student_code=@Student_code
END

27
EXEC STUDENTS_UPDATE
@Student_code= 'S001',
@Full_name= 'Tran Ngoc Thien Thanh',
@Sex='Female',
@S_Address='Nam Dinh',
@S_Ethnicity='Kinh'

28
SELECT*FROM STUDENTS

Question 11: Create procedure delete Program. Show Faculty_code, Faculty_name.


ALTER PROCEDURE FACULTY_DELETE
@Faculty_name VARCHAR(100)
AS
BEGIN
DELETE FACULTY WHERE Faculty_name=@Faculty_name
END

29
Question 12: Create trigger insert Result. Show table results.
CREATE TRIGGER tg_Score ON RESULT AFTER INSERT
AS
BEGIN
SET NOCOUNT ON;

DECLARE @count DECIMAL (4,2);

SELECT @count = COUNT(*) FROM inserted WHERE Average_score_semester_1 > 10


IF(@count > 0)
BEGIN
RAISERROR('Average score semester 1 is greater than 10.', 16, 1);
ROLLBACK TRANSACTION;
RETURN;
END

SELECT @count = COUNT(*) FROM inserted WHERE Average_score_semester_2 > 10


IF(@count > 0)
BEGIN
RAISERROR('Average score semester 2 is greater than 10.', 16, 1);
ROLLBACK TRANSACTION;
RETURN;
END

SELECT @count = COUNT(*) FROM inserted WHERE Average_score_academic_year >


10
IF(@count > 0)
BEGIN
RAISERROR('Average score academic year is greater than 10.', 16, 1);
ROLLBACK TRANSACTION;
RETURN;
END

SELECT @count = COUNT(*) FROM inserted WHERE Average_score_semester_1 < 0


IF(@count > 0)
BEGIN
RAISERROR('Average score semester 1 is less than 0.', 16, 1);
ROLLBACK TRANSACTION;
RETURN;
END

30
SELECT @count = COUNT(*) FROM inserted WHERE Average_score_semester_2
<0
IF(@count > 0)
BEGIN
RAISERROR('Average score semester 2 is less than 0.', 16, 1);
ROLLBACK TRANSACTION;
RETURN;
END

SELECT @count = COUNT(*) FROM inserted WHERE


Average_score_academic_year < 0
IF(@count > 0)
BEGIN
RAISERROR('Average score academic year is less than 0.', 16, 1);
ROLLBACK TRANSACTION;
RETURN;
END
END;

31
SELECT*FROM RESULT

C. ĐÁNH GIÁ THÀNH VIÊN

STT Họ và tên MSSV Nhiệm Vụ Mức độ Nhóm tự đánh


hoàn thành giá
01 Trần Ngọc Thiên 22070347 1. Vẽ ERD và lược đồ 100% Tốt
Thanh quan hệ.
2. Code
3.Nghĩ câu hỏi truy vấn
02 Vũ Đức Thành 22071150 1. Viết tóm tắt về công ty 100% Tốt
2. Làm bảng Relation
Schema.
3. Nghĩ câu hỏi truy vấn
03 Vương Thịnh 22071171 1. Tìm thông tin để làm 100% Tốt
dữ liệu insert.
2. Làm slide thuyết
trình.

32
CHAPTER 3: APPENDIX
A. INSERT DATA
1. INSERT TABLE: FACULTY
INSERT INTO FACULTY (Faculty_code, Faculty_name, Founded_year)
VALUES
('FC001', 'Faculty of Applied Sciences', 2002),
('FC002', 'Faculty of Economics and Management', 2004),
('FC003', 'Faculty of Applied Linguistics', 2006);

2. INSERT TABLE: MAJOR

INSERT INTO MAJOR(Major_code, Faculty_code, Major_name, Program_names)


VALUES
('ICE', 'FC001', 'Informatics and Computer Engineering', 'Doctoral program'),
('BDA', 'FC001', 'Business Data Analytics', 'Master’s program'),
('MIS', 'FC001', 'Management Information System', 'Doctoral program'),
('AI', 'FC001', 'Automation and Informatics', 'Exchange program'),
('AIT', 'FC001', 'Applied Information Technology', 'Combined Bachelors and
Masters degree'),
('FDB', 'FC001', 'Financial Technology and Digital Business', 'Combined Bachelors
and Masters degree'),
('ISEL', 'FC001', 'Industrial Engineering and Logistics Systems', 'Combined
Bachelors and Masters degree'),
('IB', 'FC002', 'International Business', 'Undergraduate program'),
('AAA', 'FC002', 'Accounting, Analysis and Auditing', 'Undergraduate program'),
('HSTM', 'FC002', 'Hospitality, Sports and Tourism Management', 'Undergraduate
program'),
('MGT', 'FC002', 'Management', 'Dual degree'),
('MKT', 'FC002', 'Marketing', 'Dual degree'),
('IBFI', 'FC002', 'International Banking, Finance and Insurance',
'Collaborative'),
('FM', 'FC002', 'Financial Management', 'Undergraduate program'),
('BA', 'FC002', 'Business Administration', 'Undergraduate program'),
('MRO', 'FC002', 'Marketing Research and Operation', 'Undergraduate program'),
('BEL', 'FC003', 'Bachelor of English Language', 'Undergraduate program');

33
3. INSERT TABLE: SUBJECTS

INSERT INTO SUBJECTS(Subjects_code, Subjects_name, Major_code)


VALUES
('SE01', 'Software Engineering', 'ICE'),
('PS02', 'Probability and Statistics', 'BDA'),
('ACS03', 'Applied Computer Science', 'MIS'),
('HCI04', 'Human computer interaction', 'AI'),
('BF05', 'Basic Finance', 'AIT'),
('AP06', 'Accounting Principles', 'FDB'),
('QE07', 'Quantitative Economics', 'ISEL'),
('IE08', 'International Economics', 'IB'),
('OOP09', 'Object-Oriented Programming', 'AAA'),
('BOM010', 'Business Organization and Management', 'HSTM'),
('ISP011', 'Information Security Principles', 'MGT'),
('IF012', 'International Finance', 'MKT'),
('EC013', 'E-Commerce', 'IBFI'),
('BIS014', 'Banking Information Systems', 'FM'),
('BAM015', 'Business Administration', 'BA'),
('MKT016', 'Marketing', 'MRO'),
('BC017', 'Blockchain and Cryptocurrency', 'BEL'),
('DM018', 'Discrete Mathematics', 'ICE'),
('EA019', 'Economics Analysis', 'BDA'),
('D020', 'Database', 'MIS'),
('ML021', 'Machine learning', 'AI'),
('DS022', 'Data Science', 'AIT'),
('BC023', 'Blockchain and Cryptocurrency', 'FDB'),
('LS024', 'Logistics Science', 'ISEL'),
('E025', 'Environmental Economics', 'IB'),
('BDA026', 'Big Data Analysis', 'AAA'),
('WD027', 'Web Development', 'HSTM'),
('PE028', 'Public Economics', 'IB'),
('MAD029', 'Mobile app Development', 'FDB'),
('OOP030', 'Object-Oriented Programming', 'AI');

34
4. INSERT TABLE: CLASS

INSERT INTO CLASS(Class_code, Faculty_code, Major_code, Class_name)


VALUES
('ICE01', 'FC001', 'ICE', 'C1'),
('BDA01', 'FC001', 'BDA', 'C2'),
('MIS01', 'FC001', 'MIS', 'C3'),
('AI01', 'FC001', 'AI', 'C4'),
('AIT01', 'FC001', 'AIT', 'C5'),
('FDB01', 'FC001', 'FDB', 'C6'),
('ISEL01', 'FC001', 'ISEL', 'C7'),
('IB01', 'FC002', 'IB', 'C8'),
('AAA01', 'FC002', 'AAA', 'C9'),
('HSTM01', 'FC002', 'HSTM', 'C10'),
('MGT01', 'FC002', 'MGT', 'C11'),
('MKT01', 'FC002', 'MKT', 'C12'),
('IBFI01', 'FC002', 'IBFI', 'C13'),
('FM01', 'FC002', 'FM', 'C14'),
('BA01', 'FC002', 'BA', 'C15'),
('MRO01', 'FC002', 'MRO', 'C16'),
('BEL01', 'FC003', 'BEL', 'C17');

35
5. INSERT TABLE: LECTURER

INSERT INTO LECTURER (Full_name, Lecturer_code, Sex, Degree, Email, Faculty_code,


L_Ethnicity, Phone_number)
VALUES
('Chu Đình Tới', 'LC01', 'F', 'TS', '[email protected]', 'FC003', 'Kinh',
'0914770557'),
('Trần Thị Oanh', 'LC02', 'M', 'PGS.TS', '[email protected]', 'FC003',
'Kinh', '0777614886'),
('Lê Đức Thịnh', 'LC03', 'F', 'TS', '[email protected]', 'FC001', 'Kinh',
'0373890387'),
('Trương Công Đoàn', 'LC04', 'F', 'TS', '[email protected]', 'FC001', 'Kinh',
'0962015958'),
('Nguyễn Doãn Đông', 'LC05', 'F', 'TS', '[email protected]', 'FC001', 'Kinh',
'0828860744'),
('Trần Anh Hào', 'LC06', 'F', 'TS', '[email protected]', 'FC001', 'Kinh',
'0911443322'),
('Lê Xuân Hải', 'LC07', 'F', 'TS', '[email protected]', 'FC003', 'Kinh',
'0832906988'),
('Phạm Thị Việt Hương', 'LC08', 'M', 'TS', '[email protected]', 'FC002',
'Kinh', '0828466160'),
('Nguyễn Ngọc Linh', 'LC09', 'F', 'TS', '[email protected]', 'FC002', 'Kinh',
'0912443076'),
('Trần Đức Quỳnh', 'LC010', 'M', 'TS', '[email protected]', 'FC002', 'Kinh',
'0912112446'),
('Kim Đình Thái', 'LC011', 'M', 'TS', '[email protected]', 'FC002', 'Kinh',
'0912898020'),
('Nguyễn Hải Thanh', 'LC012', 'M', 'PGS.TS', '[email protected]', 'FC002',
'Kinh', '0347378888'),
('Lê Trung Thành', 'LC013', 'M', 'PGS.TS', '[email protected]', 'FC002',
'Kinh', '0906052779'),
('Nguyễn Quang Thuận', 'LC014', 'M', 'TS', '[email protected]',
'FC002', 'Kinh', '0946683886'),

36
('Lê Duy Tiến', 'LC015', 'M', 'ThS', '[email protected]', 'FC002', 'Thái',
'0834944888'),
('Bùi Thanh Tùng', 'LC016', 'M', 'ThS', '[email protected]', 'FC002',
'Kinh', '0932203045'),
('Nguyễn Thanh Tùng', 'LC017', 'M', 'PGS.TS', '[email protected]', 'FC003',
'Kinh', '0919852297'),
('Nguyễn Văn Tính', 'LC018', 'M', 'TS', '[email protected]', 'FC003', 'Kinh',
'0982956917'),
('Phạm Hải Yến', 'LC019', 'F', 'ThS', '[email protected]', 'FC001', 'Kinh',
'0856791953'),
('Nguyễn Văn Tánh', 'LC020', 'M', 'TS', '[email protected]', 'FC001', 'Kinh',
'0848098368'),
('Nguyễn Anh Tuấn', 'LC021', 'M', 'ThS', '[email protected]', 'FC003', 'Mường',
'0948402875'),
('Vũ Thị Huệ', 'LC022', 'F', 'ThS', '[email protected]', 'FC003', 'Kinh',
'0917367263'),
('Bùi Nhật Lệ', 'LC023', 'F', 'Ths', '[email protected]', 'FC001', 'Kinh',
'0915937817'),
('Nguyễn Quỳnh Hương', 'LC024', 'F', 'ThS', '[email protected]',
'FC001', 'Kinh', '0942751963'),
('Vũ Ngọc Mai', 'LC025', 'F', 'Ths', '[email protected]', 'FC002', 'Kinh',
'0932247581'),
('Thân Văn Thái', 'LC026', 'M', 'TS', '[email protected]', 'FC002', 'Kinh',
'0946516204'),
('Hà Mạnh Hùng', 'LC027', 'M', 'TS', '[email protected]', 'FC002', 'Kinh',
'0947134328'),
('Nguyễn Đăng Khoa', 'LC028', 'M', 'TS', '[email protected]', 'FC002', 'Kinh',
'0933755868'),
('Phạm Ngọc Thành', 'LC029', 'M', 'TS', '[email protected]', 'FC002', 'Kinh',
'0914361239'),
('Trần Thị Ngân', 'LC030', 'F', 'PGS. TS', '[email protected]', 'FC002',
'Kinh', '0836830866');

37
6. INSERT TABLE: STUDENTS

INSERT INTO STUDENTS(Student_code, Faculty_code, Class_code, Major_code,


Full_name, Birthdate, S_Ethnicity, Sex, S_Address)
VALUES
('S001', 'FC001', 'ICE01', 'ICE', 'John Smith', '1998-05-12', 'Caucasian',
'Male', 'New York, USA'),
('S002', 'FC001', 'BDA01', 'BDA', 'Emily Johnson', '1999-09-18', 'Asian',
'Female', 'Los Angeles, USA'),
('S003', 'FC001', 'MIS01', 'MIS', 'Michael Williams', '1997-03-25', 'African',
'Male', 'Chicago, USA'),
('S004', 'FC001', 'AI01', 'AI', 'Sophia Brown', '2000-11-08', 'Hispanic',
'Female', 'Miami, USA'),
('S005', 'FC001', 'AIT01', 'AIT', 'Daniel Lee', '1996-07-30', 'Caucasian',
'Male', 'Houston, USA'),
('S006', 'FC001', 'FDB01', 'FDB', 'Olivia Garcia', '1998-12-03', 'Hispanic',
'Female', 'Phoenix, USA'),
('S007', 'FC001', 'ISEL01', 'ISEL', 'William Martinez', '1999-04-16', 'Asian',
'Male', 'Philadelphia, USA'),
('S008', 'FC002', 'IB01', 'IB', 'Emma Rodriguez', '1997-10-22', 'Caucasian',
'Female', 'San Antonio, USA'),
('S009', 'FC002', 'AAA01', 'AAA', 'Liam Nguyen', '2001-02-09', 'Asian', 'Male',
'San Diego, USA'),
('S010', 'FC002', 'HSTM01', 'HSTM', 'Ava Hernandez', '1999-06-14', 'Hispanic',
'Female', 'Dallas, USA'),
('S011', 'FC002', 'MGT01', 'MGT', 'Ethan Kim', '1998-08-27', 'Asian', 'Male',
'San Jose, USA'),
('S012', 'FC002', 'MKT01', 'MKT', 'Mia Patel', '2000-01-31', 'Asian', 'Female',
'Austin, USA'),
('S013', 'FC002', 'IBFI01', 'IBFI', 'Alexander Smith', '1997-11-19', 'Caucasian',
'Male', 'Jacksonville, USA'),
('S014', 'FC002', 'FM01', 'FM', 'Isabella Wilson', '1999-03-05', 'African',
'Female', 'Columbus, USA'),
('S015', 'FC002', 'BA01', 'BA', 'James Brown', '1998-09-10', 'Caucasian', 'Male',
'Charlotte, USA'),
('S016', 'FC002', 'MRO01', 'MRO', 'Evelyn Nguyen', '2000-04-28', 'Asian',
'Female', 'San Francisco, USA'),
('S017', 'FC003', 'BEL01', 'BEL', 'Benjamin Garcia', '1996-12-12', 'Hispanic',
'Male', 'Indianapolis, USA'),
('S018', 'FC001', 'ICE01', 'ICE', 'Charlotte Kim', '2001-08-03', 'Asian',
'Female', 'Seattle, USA'),
('S019', 'FC001', 'BDA01', 'BDA', 'Noah Miller', '1997-02-17', 'Caucasian',
'Male', 'Denver, USA'),
('S020', 'FC001', 'MIS01', 'MIS', 'Amelia Gonzalez', '1999-07-20', 'Hispanic',
'Female', 'Washington, USA'),
('S021', 'FC001', 'AI01', 'AI', 'Emily Johnson', '1998-03-15', 'Caucasian',
'Female', 'New York, USA'),
('S022', 'FC001', 'AIT01', 'AIT', 'Daniel Lee', '1999-07-22', 'Asian', 'Male',
'Los Angeles, USA'),
('S023', 'FC001', 'FDB01', 'FDB', 'Sophia Brown', '2000-11-10', 'Hispanic',
'Female', 'Chicago, USA'),
('S024', 'FC001', 'ISEL01', 'ISEL', 'William Martinez', '1997-01-05', 'Hispanic',
'Male', 'Miami, USA'),
('S025', 'FC002', 'IB01', 'IB', 'Olivia Garcia', '1998-08-20', 'Caucasian',
'Female', 'Houston, USA'),
('S026', 'FC002', 'AAA01', 'AAA', 'Mia Patel', '2001-04-18', 'Asian', 'Female',
'Phoenix, USA'),
('S027', 'FC002', 'HSTM01', 'HSTM', 'Ethan Kim', '1999-09-30', 'Asian', 'Male',
'Philadelphia, USA'),
('S028', 'FC002', 'MGT01', 'MGT', 'Emma Rodriguez', '1998-05-12', 'Hispanic',
'Female', 'San Antonio, USA'),

38
('S029', 'FC002', 'MKT01', 'MKT', 'Liam Nguyen', '2001-10-28', 'Asian', 'Male',
'San Diego, USA'),
('S030', 'FC002', 'IBFI01', 'IBFI', 'Ava Hernandez', '1997-12-03', 'Hispanic',
'Female', 'Dallas, USA'),
('S031', 'FC002', 'FM01', 'FM', 'Alexander Smith', '2000-06-14', 'Caucasian',
'Male', 'San Jose, USA'),
('S032', 'FC002', 'BA01', 'BA', 'Isabella Wilson', '1998-02-09', 'African',
'Female', 'Austin, USA'),
('S033', 'FC002', 'MRO01', 'MRO', 'James Brown', '1999-07-17', 'Caucasian',
'Male', 'Jacksonville, USA'),
('S034', 'FC003', 'BEL01', 'BEL', 'Evelyn Nguyen', '1997-04-28', 'Asian',
'Female', 'Columbus, USA'),
('S035', 'FC001', 'ICE01', 'ICE', 'Benjamin Garcia', '2001-09-22', 'Hispanic',
'Male', 'Charlotte, USA'),
('S036', 'FC001', 'BDA01', 'BDA', 'Charlotte Kim', '1998-11-19', 'Asian',
'Female', 'San Francisco, USA'),
('S037', 'FC001', 'MIS01', 'MIS', 'Noah Miller', '2000-03-07', 'Caucasian',
'Male', 'Indianapolis, USA'),
('S038', 'FC001', 'AI01', 'AI', 'Amelia Gonzalez', '1999-05-25', 'Hispanic',
'Female', 'Seattle, USA'),
('S039', 'FC001', 'AIT01', 'AIT', 'Grace Lee', '1998-08-12', 'Asian', 'Female',
'Denver, USA'),
('S040', 'FC001', 'FDB01', 'FDB', 'Samuel Thompson', '2001-12-30', 'Caucasian',
'Male', 'Washington, USA'),
('S041', 'FC001', 'ISEL01', 'ISEL', 'Lily Davis', '1997-06-25', 'African',
'Female', 'Boston, USA'),
('S042', 'FC002', 'IB01', 'IB', 'Jacob Martinez', '1999-10-03', 'Hispanic',
'Male', 'Atlanta, USA'),
('S043', 'FC002', 'AAA01', 'AAA', 'Mia Robinson', '2000-04-18', 'Caucasian',
'Female', 'Detroit, USA'),
('S044', 'FC002', 'HSTM01', 'HSTM', 'Lucas White', '1998-09-05', 'Asian', 'Male',
'Memphis, USA'),
('S045', 'FC002', 'MGT01', 'MGT', 'Zoey Nguyen', '1997-02-15', 'Hispanic',
'Female', 'Portland, USA'),
('S046', 'FC002', 'MKT01', 'MKT', 'Elijah Rodriguez', '2001-07-20', 'Caucasian',
'Male', 'Nashville, USA'),
('S047', 'FC002', 'IBFI01', 'IBFI', 'Avery Brown', '1998-11-03', 'African',
'Female', 'Las Vegas, USA'),
('S048', 'FC002', 'FM01', 'FM', 'Jayden Kim', '1999-05-28', 'Asian', 'Male',
'Louisville, USA'),
('S049', 'FC002', 'BA01', 'BA', 'Harper Garcia', '2000-08-12', 'Hispanic',
'Female', 'Baltimore, USA'),
('S050', 'FC002', 'MRO01', 'MRO', 'Addison Nguyen', '1997-12-30', 'Caucasian',
'Male', 'Milwaukee, USA');

39
7. INSERT TABLE: RESULT

INSERT INTO RESULT (Student_code, Subjects_code, Exam_times,


Average_score_semester_1, Average_score_semester_2, Average_score_academic_year)
VALUES
('S001', 'SE01', 1, 8.5, 8.8, 8.7),
('S002', 'PS02', 1, 5.6, 4.9, 5.3),
('S003', 'ACS03', 1, 9.0, 9.2, 9.1),
('S004', 'HCI04', 1, 8.7, 8.9, 8.8),
('S005', 'BF05', 1, 7.5, 8.0, 7.8),
('S006', 'AP06', 2, 8.2, 8.5, 8.4),
('S007', 'QE07', 1, 9.1, 9.3, 9.2),
('S008', 'IE08', 1, 3.5, 5.5, 4.5),
('S009', 'OOP09', 1, 4.9, 6.7, 5.8),
('S010', 'BOM010', 1, 8.6, 8.8, 8.7),
('S011', 'ISP011', 2, 8.3, 8.7, 8.5),
('S012', 'IF012', 1, 2.5, 4.5, 3.5),
('S013', 'EC013', 1, 9.2, 9.0, 9.1),
('S014', 'BIS014', 1, 8.5, 8.7, 8.6),
('S015', 'BAM015', 2, 3.7, 7.6, 5.7),
('S016', 'MKT016', 1, 8.9, 9.1, 9.0),
('S017', 'BC017', 1, 7.8, 8.2, 8.0),
('S018', 'DM018', 2, 8.5, 8.8, 8.7),
('S019', 'EA019', 1, 5.8, 6.0, 5.9),
('S020', 'D020', 1, 8.5, 8.7, 8.6),
('S021', 'ML021', 2, 8.7, 9.0, 8.9),
('S022', 'DS022', 1, 3.5, 7.5, 5.5),
('S023', 'BC023', 1, 8.8, 9.1, 9.0),
('S024', 'LS024', 2, 9.0, 9.2, 9.1),
('S025', 'E025', 2, 4.6, 5.1, 4.9),
('S026', 'BDA026', 1, 8.6, 8.8, 8.7),
('S027', 'WD027', 1, 5.5, 3.5, 4.5),
('S028', 'PE028', 1, 8.8, 9.1, 9.0),
('S029', 'MAD029', 1, 8.2, 8.6, 8.4),
('S030', 'OOP030', 1, 7.9, 8.2, 8.1),
('S031', 'SE01', 1, 8.9, 9.2, 9.1),
('S032', 'PS02', 1, 8.5, 8.8, 8.7),
('S033', 'ACS03', 2, 2.5, 5.5, 4.0),
('S034', 'HCI04', 1, 3.5, 3.8, 3.7),
('S035', 'BF05', 1, 8.7, 8.9, 8.8),
('S036', 'AP06', 1, 3.5, 4.2, 3.9),
('S037', 'QE07', 2, 8.2, 8.5, 8.4),
('S038', 'IE08', 1, 9.1, 9.3, 9.2),
('S039', 'OOP09', 1, 8.8, 9.0, 8.9),
('S040', 'BOM010', 2, 6.1, 7.4, 6.3),
('S041', 'ISP011', 1, 8.6, 8.8, 8.7),
('S042', 'IF012', 1, 8.3, 8.7, 8.5),
('S043', 'EC013', 1, 4.5, 7.5, 6.0),
('S044', 'BIS014', 2, 5.9, 6.9, 6.4),
('S045', 'BAM015', 1, 8.5, 8.7, 8.6),
('S046', 'MKT016', 1, 9.2, 9.4, 9.3),
('S047', 'BC017', 2, 8.9, 9.1, 9.0),
('S048', 'DM018', 1, 7.8, 8.2, 8.0),
('S049', 'EA019', 1, 8.5, 8.8, 8.7),
('S050', 'D020', 1, 9.3, 9.5, 9.4);

40
8. INSERT TABLE: AWARDS

INSERT INTO AWARDS(Award_code, Student_code, Scholarship)


VALUES
('AW001', 'S013', '$1000'),
('AW002', 'S038', '$1500'),
('AW003', 'S003', '$1200'),
('AW004', 'S004', '$1100'),
('AW005', 'S005', '$1300'),
('AW006', 'S034', '$1400'),
('AW007', 'S027', '$1250'),
('AW008', 'S016', '$1350'),
('AW009', 'S050', '$1800'),
('AW010', 'S046', '$1700');

41

You might also like