Professional Documents
Culture Documents
I confirm that I understand my coursework needs to be submitted online via Google Classroom under the
relevant module page before the deadline in order for my assignment to be accepted and marked. I am
fully aware that late submissions will be treated as non-submission and a marks of zero will be awarded.
Table of Contents
1. Introduction ............................................................................................................... 1
1.1 Introduction of the College ................................................................................. 1
1.2 Current Business Activities and Operations..................................................... 1
1.3 Business Rule ...................................................................................................... 2
1.4 Creation of Entities and Attributes .................................................................... 3
1.5 Initial ER Diagram ................................................................................................ 4
2. Part-1 Database Design ............................................................................................ 4
2.1 Assumptions ........................................................................................................ 4
2.2. Normalization ...................................................................................................... 5
2.1.1 Un-Normalized form ...................................................................................... 5
2.1.2 1NF ................................................................................................................. 6
2.1.3 2NF ................................................................................................................. 7
2.1.4 3NF ............................................................................................................... 10
2.3 Final ERD ........................................................................................................... 12
3. Part-2 Database Implementation............................................................................ 14
3.1 Table Generation ................................................................................................. 14
3.2 Populating Database ........................................................................................... 30
4. Part-3 Database Querying ...................................................................................... 70
4.1 Information Queries ............................................................................................. 70
4.2 Transaction Queries ............................................................................................ 80
4.3 Dropping Table Queries ...................................................................................... 86
5. Part-4 Dump File Creation ...................................................................................... 90
6. Part-5 Conclusion ................................................................................................... 92
Bibliography ................................................................................................................ 93
List of Figures
List of Tables
1. Introduction
1.1 Introduction of the College
Islington College was founded in 1997 and is located in Kamalpokhari, Kathmandu. As a
result of its affiliation with London Metropolitan University, the college offers its students
an internationally recognized degree. Students can enroll in a variety of courses at
Islington College, including BIT, BBA, and MBA. The college provides a pleasant study
atmosphere with sufficient opportunity.
Each module has Lectures, Tutorials, and Lab classes, therefore the college has an
excellent teaching method. It allows students to engage in class discussions and to learn
as much as possible through hands-on activities. Islington College aspires to equip
students with a degree from London Metropolitan University in the Uk. The college's
mission is straightforward and straightforward. It focuses on the student's best interests.
The college intends to expand in the near future in order to accommodate more students
and provide them with the best possible learning quality.
Aside from academics, Islington College offers a variety of extracurricular activities to its
students. Every year, it organizes spring carnivals, other sporting events, and a variety of
other activities. The college also recognizes the value of sportsmanship and has
constructed facilities for basketball, football, and table tennis.
• The college uses a Database Management System to keep track of all of the information
on the people who work there.
• It accepts students for three primary courses each year: BBA, BIT, and MBA.
• BIT and MBA are three-year programs, whereas BBA is a four-year program.
1
19033689
CC5051NA DATABASES SYSTEMS
• The student's semester fees are determined by the program in which they enroll.
• The college is open six days a week, with each module including a lecture, tutorial, and
lab class.
• The college is open from 7:00 a.m. to 5:00 p.m. seven days a week. Because there are
often hours of gap between sessions, the class schedule has been designed so that
students can have their own time in the college for self-study, sporting activities, and other
activities.
Islington College adheres to the following business rules: • The college database must
contain all student and instructor data.
• It should be able to maintain track of all people's mailing addresses, both temporary and
permanent.
• The college provides a variety of courses, each with its own set of requirements.
• A single instructor can teach several courses, whereas an instructor cannot teach
multiple courses.
2
19033689
CC5051NA DATABASES SYSTEMS
Entities Attributes
3
19033689
CC5051NA DATABASES SYSTEMS
4
19033689
CC5051NA DATABASES SYSTEMS
• A class can have many modules, and a module can be taught in multiple classes.
• A specification can have several teachers, but an instructor can only teach one
specification at a time.
• Teachers who teach the same subject earn the same remuneration.
2.2. Normalization
With the introduction of the First Normal Form, the architect of the relational model, Edgar
Codd, presented the idea of data normalization, which he continued to enhance with the
Second and Third Normal Forms. Later, he collaborated with Raymond F. Boyce to
establish the Boyce-Codd Normal Form theory. (Guru99, 2020)
5
19033689
CC5051NA DATABASES SYSTEMS
transitive dependencies of any kind. The symbol 0NF is sometimes used to represent
unnormalized relations, however this should not be mistaken with a denormalized
connection. Any relation in its raw state is an unnormalized relation, and they frequently
contain recurring values and other features that are not found in denormalized relations.
Denormalization is an intentional attempt to introduce controlled duplicate objects into a
previously normalized state. (Consulting, 2020)
2.1.2 1NF
First normal form (1NF) sets the fundamental rules for database normalization
and relates to a single table within a relational database system. (Techopedia, 2020) The
First normalized form is implemented as follow:
Courses-1 (Course_ID, Name, Completion_Time)
6
19033689
CC5051NA DATABASES SYSTEMS
2.1.3 2NF
A relation is in second normal form if it is in 1NF and every non key attribute is
fully functionally dependent on the primary key. (Gitta, 2020)
For Student:
For Permanent_Std_Address:
7
19033689
CC5051NA DATABASES SYSTEMS
Permanent _Std_Address_ID
For Temporary_Std_Address:
Temporary_ Std_Address_ID
For Instructor:
Instructor_id, Course_id
Instructor_id, Module_id
For Permanent_Inst_Address:
Permanent _Address_ID, Instructor_ID Country, Province, City, Street,
House_Number, Phone, Fax
Permanent _Address_ID
For Temporary_Inst_Address:
8
19033689
CC5051NA DATABASES SYSTEMS
Temporary _Address_ID
For Specifications:
Specification_ID, Course_ID
For Modules:
Module_ID, Course_ID
Module_ID, Specification_ID
Module_ID Name
For Class:
Class_ID, Module_Code
Class_ID Class_Name
9
19033689
CC5051NA DATABASES SYSTEMS
2.1.4 3NF
A relation is in third normal form if there is no transitive dependency for nonprime
attributes (and is also in the second form). (Techopedia, 2020)
In Student_Course:
10
19033689
CC5051NA DATABASES SYSTEMS
11
19033689
CC5051NA DATABASES SYSTEMS
12
19033689
CC5051NA DATABASES SYSTEMS
13
19033689
CC5051NA DATABASES SYSTEMS
For Courses
14
19033689
CC5051NA DATABASES SYSTEMS
For Specifications
For Modules
15
19033689
CC5051NA DATABASES SYSTEMS
For Class
16
19033689
CC5051NA DATABASES SYSTEMS
For GPA
For Student
17
19033689
CC5051NA DATABASES SYSTEMS
For Instructor
18
19033689
CC5051NA DATABASES SYSTEMS
For Temporary_Std_Address
Student_ID number(10),
REFERENCES Student(Student_ID));
19
19033689
CC5051NA DATABASES SYSTEMS
For Permanent_Std_Address
Student_ID number(10),
20
19033689
CC5051NA DATABASES SYSTEMS
REFERENCES Student(Student_ID));
For Temporary_Inst_Address
Instructor_ID number(10),
21
19033689
CC5051NA DATABASES SYSTEMS
REFERENCES Instructor(Instructor_ID));
For Permanent_Inst_Address
Instructor_ID number(10),
22
19033689
CC5051NA DATABASES SYSTEMS
REFERENCES Instructor(Instructor_ID));
For Student_Courses
Course_ID number(10),
23
19033689
CC5051NA DATABASES SYSTEMS
Course_Marks number(10),
REFERENCES Student(Student_ID),
REFERENCES Courses(Course_ID),
REFERENCES GPA(Course_Marks));
For Student_Specifications
Student_ID number(10),
Specification_ID number(10),
24
19033689
CC5051NA DATABASES SYSTEMS
REFERENCES Student(Student_ID),
REFERENCES Specifications(Specification_ID));
For Instructor_Specifications
Instructor_ID number(10),
Specification_ID number(10),
REFERENCES Instructor(Instructor_ID),
CONSTRAINT FK_ISS FOREIGN KEY (Specification_ID)
REFERENCES Specifications(Specification_ID));
25
19033689
CC5051NA DATABASES SYSTEMS
Course_ID number(10),
Specification_ID number(10),
REFERENCES Courses(Course_ID),
REFERENCES Specifications(Specification_ID));
26
19033689
CC5051NA DATABASES SYSTEMS
For Instructor_modules
REFERENCES Instructor(Instructor_ID),
REFERENCES Modules(Module_Code));
27
19033689
CC5051NA DATABASES SYSTEMS
For Specifications_Modules
REFERENCES Specifications(Specification_ID),
REFERENCES Modules(Module_Code));
28
19033689
CC5051NA DATABASES SYSTEMS
For Class_Modules
REFERENCES Class(Class_ID),
REFERENCES Modules(Module_Code));
29
19033689
CC5051NA DATABASES SYSTEMS
For Courses
INSERT INTO Courses (Course_ID, Course_Name, Completion_Time)
VALUES (1, 'BIT', '3 Years');
INSERT INTO Courses (Course_ID, Course_Name, Completion_Time)
VALUES (2, 'BBA', '4 Years');
INSERT INTO Courses (Course_ID, Course_Name, Completion_Time)
VALUES (3, 'MBA', '3 Years');
30
19033689
CC5051NA DATABASES SYSTEMS
For Specifications
INSERT INTO Specifications (Specification_ID, Specification_Name, Semester_Fee)
VALUES (1, 'Computing', 100000);
INSERT INTO Specifications (Specification_ID, Specification_Name, Semester_Fee)
VALUES (2, 'Networking', 90000);
INSERT INTO Specifications (Specification_ID, Specification_Name, Semester_Fee)
VALUES (3, 'Business and Marketing', 115000);
INSERT INTO Specifications (Specification_ID, Specification_Name, Semester_Fee)
VALUES (4, 'Banking and Insurance', 105000);
INSERT INTO Specifications (Specification_ID, Specification_Name, Semester_Fee)
VALUES (5, 'Finance', 123000);
INSERT INTO Specifications (Specification_ID, Specification_Name, Semester_Fee)
VALUES (6, 'Entrepreneurship', 118000);
31
19033689
CC5051NA DATABASES SYSTEMS
For Modules
INSERT INTO Modules (Module_Code, Module_Name)
VALUES ('C1', 'Programming');
INSERT INTO Modules (Module_Code, Module_Name)
VALUES ('C2', 'Database');
INSERT INTO Modules (Module_Code, Module_Name)
VALUES ('C3', 'Logic and Problem Sloving');
INSERT INTO Modules (Module_Code, Module_Name)
VALUES ('N1', 'Programming');
INSERT INTO Modules (Module_Code, Module_Name)
32
19033689
CC5051NA DATABASES SYSTEMS
33
19033689
CC5051NA DATABASES SYSTEMS
34
19033689
CC5051NA DATABASES SYSTEMS
For Class
INSERT INTO Class (Class_ID, Class_Name)
VALUES (1, 'Annapurna');
INSERT INTO Class (Class_ID, Class_Name)
VALUES (2, 'Kantipur');
INSERT INTO Class (Class_ID, Class_Name)
VALUES (3, 'Everest');
INSERT INTO Class (Class_ID, Class_Name)
VALUES (4, 'London');
INSERT INTO Class (Class_ID, Class_Name)
VALUES (5, 'Birmingham');
35
19033689
CC5051NA DATABASES SYSTEMS
For GPA
INSERT INTO GPA (Course_marks, GPA)
VALUES (44, '1.76');
INSERT INTO GPA (Course_marks, GPA)
VALUES (49, '1.96');
INSERT INTO GPA (Course_marks, GPA)
VALUES (56, '2.24');
INSERT INTO GPA (Course_marks, GPA)
VALUES (59, '2.36');
INSERT INTO GPA (Course_marks, GPA)
VALUES (65, '2.6');
INSERT INTO GPA (Course_marks, GPA)
VALUES (66, '2.64');
INSERT INTO GPA (Course_marks, GPA)
VALUES (72, '2.88');
INSERT INTO GPA (Course_marks, GPA)
VALUES (76, '3.04');
INSERT INTO GPA (Course_marks, GPA)
VALUES (77, '3.08');
INSERT INTO GPA (Course_marks, GPA)
VALUES (88, '3.52');
INSERT INTO GPA (Course_marks, GPA)
VALUES (95, '3.8');
INSERT INTO GPA (Course_marks, GPA)
VALUES (97, '3.88');
For Student
INSERT INTO Student (Student_ID, Std_Name, Age, Gender, Joining_Date)
VALUES (1, 'Abhishek Khadka', 20, 'Male', '07-Sep-2018');
36
19033689
CC5051NA DATABASES SYSTEMS
INSERT INTO Student (Student_ID, Std_Name, Age, Gender, Joining_Date) VALUES (2,
'Ariana Acharya', 21, 'Female', '15-May-2017');
INSERT INTO Student (Student_ID, Std_Name, Age, Gender, Joining_Date)
VALUES (3, 'Binesh Dangol', 19, 'Male', '11-Sep-2018');
INSERT INTO Student (Student_ID, Std_Name, Age, Gender, Joining_Date)
VALUES (4, 'Catie Lahm', 23, 'Female', '07-May-2020');
INSERT INTO Student (Student_ID, Std_Name, Age, Gender, Joining_Date)
VALUES (5, 'Dilip Bhusal', 22, 'Male', '23-May-2019');
INSERT INTO Student (Student_ID, Std_Name, Age, Gender, Joining_Date)
VALUES (6, 'Diana Thapa', 20, 'Female', '17-Sep-2018');
INSERT INTO Student (Student_ID, Std_Name, Age, Gender, Joining_Date)
VALUES (7, 'Hari Shrestha', 24, 'Male', '26-May-2019');
INSERT INTO Student (Student_ID, Std_Name, Age, Gender, Joining_Date)
VALUES (8, 'Heena Malla', 18, 'Female', '07-Sep-2020');
INSERT INTO Student (Student_ID, Std_Name, Age, Gender, Joining_Date)
VALUES (9, 'Ishwor Bohara', 21, 'Male', '27-Sep-2019');
INSERT INTO Student (Student_ID, Std_Name, Age, Gender, Joining_Date)
VALUES (10, 'Jenisha Chhetri', 20, 'Female', '26-May-2018');
INSERT INTO Student (Student_ID, Std_Name, Age, Gender, Joining_Date)
VALUES (11, 'Kushal Khadka', 20, 'Male', '17-May-2019');
INSERT INTO Student (Student_ID, Std_Name, Age, Gender, Joining_Date)
VALUES (12, 'Sam Smith', 19, 'Male', '07-May-2020');
37
19033689
CC5051NA DATABASES SYSTEMS
38
19033689
CC5051NA DATABASES SYSTEMS
For Instructor
INSERT INTO Instructor (Instructor_ID, Inst_Name, Age, Gender, Course_Leader,
Module_Leader)
VALUES (1, 'Avinash karki', 29, 'Male', 'No', 'No');
INSERT INTO Instructor (Instructor_ID, Inst_Name, Age, Gender, Course_Leader,
Module_Leader)
VALUES (2, 'Bishant KC', 44, 'Male', 'No', 'Yes');
INSERT INTO Instructor (Instructor_ID, Inst_Name, Age, Gender, Course_Leader,
Module_Leader)
VALUES (3, 'Binita Bhandari', 34, 'Female', 'Yes', 'No');
INSERT INTO Instructor (Instructor_ID, Inst_Name, Age, Gender, Course_Leader,
Module_Leader)
VALUES (4, 'Deepa Bista', 29, 'Female', 'No', 'No');
INSERT INTO Instructor (Instructor_ID, Inst_Name, Age, Gender, Course_Leader,
Module_Leader)
39
19033689
CC5051NA DATABASES SYSTEMS
For Temporary_Std_Address
INSERT INTO Temporary_Std_Address (Temporary_Std_Address_ID, Student_ID,
Country, Province, City, Street, House, Phone, Fax)
VALUES (1, 1, 'Nepal', 'Bagmati', 'Kathmandu', 'Bhainsepati', '56', '01-2255447',
'2258741256');
INSERT INTO Temporary_Std_Address (Temporary_Std_Address_ID, Student_ID,
Country, Province, City, Street, House, Fax)
40
19033689
CC5051NA DATABASES SYSTEMS
41
19033689
CC5051NA DATABASES SYSTEMS
42
19033689
CC5051NA DATABASES SYSTEMS
For Permanent_Std_Address
INSERT INTO Permanent_Std_Address (Permanent_Std_Address_ID, Student_ID,
Country, Province, City, Street, House, Phone, Fax)
VALUES (1, 1, 'Nepal', 'Bagmati', 'Kathmandu', 'Bhainsepati', '56', '01-2255447',
'2258741256');
INSERT INTO Permanent_Std_Address (Permanent_Std_Address_ID, Student_ID,
Country, Province, City, Street, House, Fax)
VALUES (2, 2, 'Nepal', 'Gandaki', 'Dharan', 'Pipalbot', '87', '1452145895');
INSERT INTO Permanent_Std_Address (Permanent_Std_Address_ID, Student_ID,
Country, Province, City, Street, House, Phone, Fax)
VALUES (3, 3, 'Nepal', 'Bagmati', 'Lalitpur', 'Dhol', '11', '01-5594586', '4587125478');
INSERT INTO Permanent_Std_Address (Permanent_Std_Address_ID, Student_ID,
Country, Province, City, Street, House, Phone, Fax)
VALUES (4, 4, 'Nepal', 'Karnali', 'Khempu', 'Bhiralobato', '99', '01-4545447',
'2257041256');
INSERT INTO Permanent_Std_Address (Permanent_Std_Address_ID, Student_ID,
Country, Province, City, Street, House, Fax)
VALUES (5, 5, 'Nepal', 'Bagmati', 'Lalitpur', 'Khokana', '77', '4587854695');
INSERT INTO Permanent_Std_Address (Permanent_Std_Address_ID, Student_ID,
Country, Province, City, Street, House, Phone, Fax)
VALUES (6, 6, 'Nepal', 'Lumbini', 'Butwal', 'Chaumode', '51', '01-1145874',
'7854125756');
INSERT INTO Permanent_Std_Address (Permanent_Std_Address_ID, Student_ID,
Country, Province, City, Street, House, Phone, Fax)
VALUES (7, 7, 'Nepal', 'Bagmati', 'Kathmandu', 'Magarchok', '45', '01-7785417',
'5584741256');
INSERT INTO Permanent_Std_Address (Permanent_Std_Address_ID, Student_ID,
Country, Province, City, Street, House, Fax)
VALUES (8, 8, 'Nepal', 'Bagmati', 'Lalitpur', 'Bungmati', '58', '7854269695');
INSERT INTO Permanent_Std_Address (Permanent_Std_Address_ID, Student_ID,
Country, Province, City, Street, House, Phone, Fax)
43
19033689
CC5051NA DATABASES SYSTEMS
44
19033689
CC5051NA DATABASES SYSTEMS
For Temporary_Inst_Address
INSERT INTO Temporary_Inst_Address (Temporary_Inst_Address_ID, Instructor_ID,
Country, Province, City, Street, House, Phone, Fax)
VALUES (1, 1, 'Nepal', 'Bagmati', 'Kathmandu', 'Bhainsepati', '89', '01-
2255447/9845125478', '2258748886');
45
19033689
CC5051NA DATABASES SYSTEMS
46
19033689
CC5051NA DATABASES SYSTEMS
'8854471756');
INSERT INTO Temporary_Inst_Address (Temporary_Inst_Address_ID, Instructor_ID,
Country, Province, City, Street, House, Fax)
VALUES (11, 11, 'Nepal', 'Bagmati', 'Lalitpur', 'Dhobighat', '410', '4558412795');
INSERT INTO Temporary_Inst_Address (Temporary_Inst_Address_ID, Instructor_ID,
Country, Province, City, Street, House, Phone, Fax)
VALUES (12, 12, 'Nepal', 'Bagmati', 'Lalitpur', 'Gairibato', '051', '01-
5555556/9854125478', '1114511116');
47
19033689
CC5051NA DATABASES SYSTEMS
For Permanent_Inst_Address
INSERT INTO Permanent_Inst_Address (Permanent_Inst_Address_ID, Instructor_ID,
Country, Province, City, Street, House, Phone, Fax)
VALUES (1, 1, 'Nepal', 'Bagmati', 'Kathmandu', 'Bhainsepati', '89', '01-
2255447/9845125478', '2258748886');
INSERT INTO Permanent_Inst_Address (Permanent_Inst_Address_ID, Instructor_ID,
Country, Province, City, Street, House, Fax)
48
19033689
CC5051NA DATABASES SYSTEMS
49
19033689
CC5051NA DATABASES SYSTEMS
For Courses_Specifications
INSERT INTO Courses_Specifications (Course_ID, Specification_ID)
50
19033689
CC5051NA DATABASES SYSTEMS
For Specifications_Modules
INSERT INTO Specifications_Modules (Specification_ID, Module_Code)
VALUES (1, 'C1');
INSERT INTO Specifications_Modules (Specification_ID, Module_Code)
VALUES (1, 'C2');
INSERT INTO Specifications_Modules (Specification_ID, Module_Code)
VALUES (1, 'C3');
INSERT INTO Specifications_Modules (Specification_ID, Module_Code)
VALUES (2, 'N1');
INSERT INTO Specifications_Modules (Specification_ID, Module_Code)
VALUES (2, 'N2');
INSERT INTO Specifications_Modules (Specification_ID, Module_Code)
VALUES (3, 'BM1');
INSERT INTO Specifications_Modules (Specification_ID, Module_Code)
VALUES (3, 'BM2');
INSERT INTO Specifications_Modules (Specification_ID, Module_Code) VALUES (4,
'BI1');
INSERT INTO Specifications_Modules (Specification_ID, Module_Code)
51
19033689
CC5051NA DATABASES SYSTEMS
52
19033689
CC5051NA DATABASES SYSTEMS
53
19033689
CC5051NA DATABASES SYSTEMS
For Class_Modules
INSERT INTO Class_Modules (Class_ID, Module_Code)
VALUES (1, 'C1');
INSERT INTO Class_Modules (Class_ID, Module_Code)
VALUES (3, 'C2');
INSERT INTO Class_Modules (Class_ID, Module_Code)
VALUES (4, 'C3');
54
19033689
CC5051NA DATABASES SYSTEMS
55
19033689
CC5051NA DATABASES SYSTEMS
56
19033689
CC5051NA DATABASES SYSTEMS
For Student_Courses
INSERT INTO Student_Courses (Student_ID, Course_ID, Course_Marks)
VALUES (1, 1, 65);
INSERT INTO Student_Courses (Student_ID, Course_ID, Course_Marks)
VALUES (2, 1, 88);
INSERT INTO Student_Courses (Student_ID, Course_ID, Course_Marks)
VALUES (3, 1, 59);
INSERT INTO Student_Courses (Student_ID, Course_ID, Course_Marks) VALUES (4, 1,
77);
57
19033689
CC5051NA DATABASES SYSTEMS
58
19033689
CC5051NA DATABASES SYSTEMS
59
19033689
CC5051NA DATABASES SYSTEMS
For Student_Specifications
INSERT INTO Student_Specifications (Student_ID, Specification_ID)
VALUES (1, 1);
INSERT INTO Student_Specifications (Student_ID, Specification_ID)
VALUES (2, 1);
INSERT INTO Student_Specifications (Student_ID, Specification_ID)
VALUES (3, 2);
INSERT INTO Student_Specifications (Student_ID, Specification_ID)
VALUES (4, 2);
INSERT INTO Student_Specifications (Student_ID, Specification_ID)
VALUES (5, 3);
INSERT INTO Student_Specifications (Student_ID, Specification_ID)
VALUES (6, 3);
60
19033689
CC5051NA DATABASES SYSTEMS
61
19033689
CC5051NA DATABASES SYSTEMS
62
19033689
CC5051NA DATABASES SYSTEMS
For Instructor_Specifications
INSERT INTO Instructor_Specifications (Instructor_ID, Specification_ID, Salary)
VALUES (1, 1, 50000);
INSERT INTO Instructor_Specifications (Instructor_ID, Specification_ID, Salary)
VALUES (2, 1, 50000);
INSERT INTO Instructor_Specifications (Instructor_ID, Specification_ID, Salary)
VALUES (3, 2, 48000);
INSERT INTO Instructor_Specifications (Instructor_ID, Specification_ID, Salary)
VALUES (4, 2, 48000);
INSERT INTO Instructor_Specifications (Instructor_ID, Specification_ID, Salary)
VALUES (5, 3, 57000);
63
19033689
CC5051NA DATABASES SYSTEMS
64
19033689
CC5051NA DATABASES SYSTEMS
65
19033689
CC5051NA DATABASES SYSTEMS
For Instructor_Modules
INSERT INTO Instructor_Modules (Instructor_ID, Module_Code)
VALUES (1, 'C1');
INSERT INTO Instructor_Modules (Instructor_ID, Module_Code)
VALUES (2, 'C2');
INSERT INTO Instructor_Modules (Instructor_ID, Module_Code)
VALUES (2, 'C3');
INSERT INTO Instructor_Modules (Instructor_ID, Module_Code)
VALUES (3, 'N1');
INSERT INTO Instructor_Modules (Instructor_ID, Module_Code)
VALUES (4, 'N2');
INSERT INTO Instructor_Modules (Instructor_ID, Module_Code)
VALUES (5, 'BM1');
INSERT INTO Instructor_Modules (Instructor_ID, Module_Code)
VALUES (6, 'BM2');
INSERT INTO Instructor_Modules (Instructor_ID, Module_Code)
66
19033689
CC5051NA DATABASES SYSTEMS
67
19033689
CC5051NA DATABASES SYSTEMS
68
19033689
CC5051NA DATABASES SYSTEMS
69
19033689
CC5051NA DATABASES SYSTEMS
IO1. List all the students with all their addresses with their phone numbers.
SELECT
B.Std_Name,
A.Permanent_Std_Address_ID,
A.Phone,
C.Temporary_Std_Address_ID,
C.Phone
FROM
Permanent_Std_Address A,
Student B,
Temporary_Std_Address C
WHERE
A.Student_ID=B.Student_ID
AND
C.Student_ID=B.Student_ID;
70
19033689
CC5051NA DATABASES SYSTEMS
IQ2. List all the modules which are taught by more than one instructor.
SELECT
Modules.Module_Name,
Modules.Module_Code,
COUNT(Instructor_Modules.Instructor_ID) As No_of_Instructors
FROM Modules
JOIN Instructor_Modules
ON Modules.Module_Code=Instructor_Modules.Module_Code
GROUP BY Modules.Module_Name,Modules.Module_Code
HAVING Count(Instructor_Modules.Instructor_ID) > 1;
71
19033689
CC5051NA DATABASES SYSTEMS
IQ3. List the name of all the instructors whose name contains ‘s’ and salary is
above 50,000.
72
19033689
CC5051NA DATABASES SYSTEMS
SELECT
Instructor.Inst_Name
FROM
Instructor
JOIN
Instructor_Specifications ON
Instructor.Instructor_ID=Instructor_Specifications.Instructor_ID
WHERE
Instructor.Inst_Name LIKE '%s%'
AND
Instructor_Specifications.Salary > 50000;
73
19033689
CC5051NA DATABASES SYSTEMS
Select Modules.Module_Name
FROM
Modules
JOIN
Specifications_Modules
ON Modules.Module_Code=Specifications_Modules.Module_Code
WHERE Specifications_Modules.Specification_ID=1;
IQ5. List the name of the head of modules with the list of his phone number.
Select Instructor.Inst_Name,
Temporary_Inst_Address.Phone
FROM
Instructor,
74
19033689
CC5051NA DATABASES SYSTEMS
Temporary_Inst_Address
WHERE
Instructor.Instructor_ID=Temporary_Inst_Address.Instructor_ID
AND Instructor.Module_Leader='Yes';
WHERE Student_Specifications.Specification_ID=2;
IQ7. List the fax number of the instructor who teaches the ‘database’ module.
Select Instructor.Inst_Name,
Instructor_Modules.Instructor_ID,
Temporary_Inst_Address.Fax
FROM
Instructor,
Instructor_Modules,
Temporary_Inst_Address
WHERE
76
19033689
CC5051NA DATABASES SYSTEMS
Instructor.Instructor_ID=Instructor_Modules.Instructor_ID
AND
Instructor.Instructor_ID=Temporary_Inst_Address.Instructor_ID
AND
Instructor_Modules.Module_Code='C2';
IQ8. List the specification falls under the BIT course. Select
specifications.specification_name, courses.course_name,
Courses_Specifications.Course_ID,
Courses_Specifications.Specification_ID
FROM
specifications, courses,
Courses_Specifications
WHERE
Courses_Specifications.Specification_ID=specifications.Specification_ID
AND
77
19033689
CC5051NA DATABASES SYSTEMS
Courses_Specifications.course_ID=courses.course_ID
AND Courses_Specifications.course_ID=1;
IQ9. List all the modules taught in any one particular class.
SELECT Modules.Module_Name,
Class.Class_Name,
Class_Modules.Class_ID,
Class_Modules.Module_Code
FROM
Modules,
Class,
Class_Modules
WHERE
Class_Modules.Class_ID=Class.Class_ID
AND
Class_Modules.Module_Code=Modules.Module_Code;
78
19033689
CC5051NA DATABASES SYSTEMS
IQ10. List all the teachers with all their addresses who have ‘a’ at the end of their
first names.
SELECT
B.Inst_Name,
A.Permanent_Inst_Address_ID,
A.Phone,
C.Temporary_Inst_Address_ID,
C.Phone
FROM
Permanent_Inst_Address A,
Instructor B,
Temporary_Inst_Address C
WHERE
A.Instructor_ID=B.Instructor_ID
79
19033689
CC5051NA DATABASES SYSTEMS
AND
C.Instructor_ID=B.Instructor_ID
AND
B.Inst_Name LIKE '%a';
TQ1. Show the students, course they enroll in and their fees. Reduce 10% of the
fees if they are enrolled in a computing course.
SELECT Student.Student_id,Student.Std_Name,
Specifications.Specification_name,Specifications.Semester_fee,
DECODE(Specifications.Specification_name,'Computing',Semester_fee-
(Semester_fee*(10/100)),Specifications.Semester_fee) As NEW_Specification_fee
FROM Student
JOIN Student_specifications
ON Student.Student_id=Student_specifications.Student_id
JOIN Specifications
ON Specifications.Specification_ID=Student_specifications.specification_ID;
80
19033689
CC5051NA DATABASES SYSTEMS
TQ2. Place the default Number 1234567890 if the list of phone numbers to the
location of the address is empty and give the column name as ‘Contact details.
SELECT Country,province,city,Street,House,
COALESCE(Temporary_Std_Address.Phone, '1234567890') AS Contact_detail
FROM Temporary_Std_Address;
OR,
SELECT Country,province,city,Street,House,
COALESCE(Permanent_Std_Address.Phone, '1234567890') AS Contact_detail FROM
Permanent_Std_Address;
81
19033689
CC5051NA DATABASES SYSTEMS
TQ3. Show the name of all the students with the number of weeks since they have
enrolled in the course.
SELECT Std_name,
(SYSDATE-joining_date )/7 AS "No of Enrolled week"
FROM Student;
82
19033689
CC5051NA DATABASES SYSTEMS
TQ4. Show the name of the instructors who got equal salary and work in the same
specification.
SELECT a.Inst_Name, b.Salary,
c.Specification_Name
FROM
Instructor a,
83
19033689
CC5051NA DATABASES SYSTEMS
Instructor_Specifications b,
Specifications c
WHERE
b.Instructor_ID=a.Instructor_ID
AND
b.Specification_ID=c.Specification_ID;
TQ5. List all the courses with the total number of students enrolled course name
and the highest marks obtained. Select * from student_courses
ORDER BY Course_Marks DESC;
84
19033689
CC5051NA DATABASES SYSTEMS
TQ6. List all the instructors who are also a course leader.
Select Inst_Name, Module_Leader
FROM
Instructor
WHERE
Instructor.Module_Leader='Yes';
85
19033689
CC5051NA DATABASES SYSTEMS
86
19033689
CC5051NA DATABASES SYSTEMS
87
19033689
CC5051NA DATABASES SYSTEMS
88
19033689
CC5051NA DATABASES SYSTEMS
89
19033689
CC5051NA DATABASES SYSTEMS
The dump file for the database can be created by using the command prompt.
The code that I used was “exp cw/cw file=course.dmp” as shown in the figure below:
90
19033689
CC5051NA DATABASES SYSTEMS
91
19033689
CC5051NA DATABASES SYSTEMS
6. Part-5 Conclusion
This course material was assigned to us in week 7, when I had never heard of the phrase
"Normalization." I had trouble comprehending the question because the notion of
normalization was new to me. I watched a lot of online lessons and read the reading
materials that were uploaded to Google Classroom. That greatly aided my comprehension
of the notion of normalization.
The task at hand was to create a database for a college management system. Because I
choose our own college, drafting the skeleton was not tough at start. However, after I
began the normalization process, I had numerous challenges, which I eventually
overcame with the assistance of our professors and friends.
To summarize, I am grateful to all of the teachers who have assisted us through emails
and tutorial sessions, especially at this difficult period when we are unable to attend actual
courses.
92
19033689
CC5051NA DATABASES SYSTEMS
Bibliography
Consulting, B., 2020. tp_Oracle_physical_design_unnormalized. [Online]
Available at: http://www.remote-dba.net/tp_Oracle_physical_design_unnormalized.htm
[Accessed 2020].
Gitta, 2020. DataConsiten_Norm2NF. [Online]
Available at: http://www.gitta.info/LogicModelin/en/html/DataConsiten_Norm2NF.html
[Accessed 2020].
Guru99, 2020. database-normalization. [Online]
Available at: https://www.guru99.com/database-normalization.html [Accessed
2020].
Techopedia, 2020. first-normal-form-1nf. [Online]
Available at: https://www.techopedia.com/definition/25955/first-normal-form-1nf
[Accessed 2020].
Techopedia, 2020. third-normal-form-3nf. [Online]
Available at: https://www.techopedia.com/definition/22561/third-normal-form-3nf
[Accessed 2020].
93
19033689