A19 CC5051NP CW1
A19 CC5051NP CW1
CS5051NP
Coursework 1
Submitted By Submitted To
Name: RajThapa Mr. Pratibha Gurung
Group: C4 Module Leader
Date: July 18, 2021 Database
London Met. ID: 19031078
Table of Contents
1 Introduction ................................................................................................................................ 6
1.1 Introduction of the College ................................................................................................. 6
1.2 Current Business Activities and Operations ....................................................................... 7
1.3 Current Business Rules ....................................................................................................... 8
1.4 Identification of Entities and Attributes .............................................................................. 9
2 Initial E-R Diagram .................................................................................................................. 11
3 Normalization ........................................................................................................................... 12
3.1 Unnormalized Normal Form (UNF) ................................................................................. 13
3.2 First Normal Form (1NF) .................................................................................................. 13
3.3 Second Normal Form (2NF) ............................................................................................. 14
3.4 Third Normal Form (3NF) ................................................................................................ 16
4 Data dictionary After normalization......................................................................................... 17
5 Final Entity Relation Diagram.................................................................................................. 20
6 Database Implementation ......................................................................................................... 21
6.1 Table Generation ............................................................................................................... 21
6.2 Populate DB tables ............................................................................................................ 24
6.3 Final Table......................................................................................................................... 27
7 Database Querying ................................................................................................................... 31
7.1 Information Query ............................................................................................................. 31
7.2 Transaction Query ............................................................................................................. 34
8 Screenshot of dump file ............................................................................................................ 37
9 Droping All Tables ................................................................................................................... 38
10 Conclusion ............................................................................................................................ 39
Table Of Figures
Figure 1: Initial Entity Relation Diagram ........................................................................................ 11
Figure 2: Final Entity Relation Diagram.......................................................................................... 20
Figure 3:Creating User and Granting Privileges to User ................................................................. 21
Figure 4:Creation and description of Country Table ....................................................................... 21
Figure 5:Creation and description of Address Table ....................................................................... 21
Figure 6:Creation and description of Person Table ......................................................................... 22
Figure 7:Creation and description of Student Table ........................................................................ 22
Figure 8:Creation and description of Instructor Table ..................................................................... 22
Figure 9:Creation of Course Table ................................................................................................... 22
Figure 10:Description of Course Table ............................................................................................ 23
Figure 11:Creation and description of Specification Table ............................................................. 23
Figure 12:Creation and description of Class Table .......................................................................... 23
Figure 13:Creation and description of Module Table ...................................................................... 23
Figure 14:Creation and description of StudentDetails Table ........................................................... 24
Figure 15:Creation and description of CourseDetails Table ............................................................ 24
Figure 16:Inserting values in Country Table ................................................................................... 24
Figure 17: Inserting values in Address Table .................................................................................. 25
Figure 18: Inserting values in Person Table..................................................................................... 25
Figure 19: Inserting values in Student Table ................................................................................... 25
Figure 20: Inserting values in Instructor Table ................................................................................ 25
Figure 21: Inserting values in Course Table .................................................................................... 26
Figure 22: Inserting values in Specification Table .......................................................................... 26
Figure 23: Inserting values in Class Table ....................................................................................... 26
Figure 24: Inserting values in Module Table ................................................................................... 26
Figure 25: Inserting values in StudentDetails Table ........................................................................ 27
Figure 26: Inserting values in CourseDetails Table ......................................................................... 27
Figure 27: Displaying values of Country Table ............................................................................... 27
Figure 28: Displaying values of Address Table ............................................................................... 28
Figure 29: Displaying values of Person Table ................................................................................. 28
Figure 30: Displaying values of Student Table ................................................................................ 29
Figure 31: Displaying values of Instructor Table ............................................................................ 29
Figure 32: Displaying values of Course Table ................................................................................. 29
Figure 33: Displaying values of Specification Table ....................................................................... 30
Figure 34: Displaying values of Class Table ................................................................................... 30
Figure 35: Displaying values of Module Table ............................................................................... 30
Figure 36: Displaying values of StudentDetails Table .................................................................... 31
Figure 37: Displaying values of CourseDetails Table ..................................................................... 31
Figure 38: Information Query No 1 ................................................................................................. 32
Figure 39: Information Query No 2 ................................................................................................. 32
Figure 40: Information Query No 3 ................................................................................................. 32
Figure 41: Information Query No 4 ................................................................................................. 33
Figure 42: Information Query No 6 ................................................................................................. 33
Figure 43: Information Query No 7 ................................................................................................. 33
Figure 44: Information Query No 8 ................................................................................................. 33
Figure 45: Information Query No 9 ................................................................................................. 34
Figure 46: Information Query No 10 ............................................................................................... 34
Figure 47: Transaction Query No 1 ................................................................................................. 34
Figure 48: Transaction Query No 2 ................................................................................................. 35
Figure 49: Transaction Query No 3 ................................................................................................. 35
Figure 50: Transaction Query No 4 ................................................................................................. 35
Figure 51: Transaction Query No 5 ................................................................................................. 36
Figure 52: Transaction Query No 6 ................................................................................................. 36
Figure 53: Creating dump file .......................................................................................................... 37
Figure 54: Dropping Tables ............................................................................................................. 38
Table Of Tables
Table 1: Un-normalized Person Table ............................................................................................... 9
Table 2: Un-normalized Student Table ............................................................................................ 10
Table 3: Un-Normalized Instructor Table ........................................................................................ 10
Table 4: Un-normalized Course Table ............................................................................................. 10
Table 5: Un-normalized Specification Table ................................................................................... 11
Table 6: Un-normalized Module Table ............................................................................................ 11
Table 7: Normalized Country Table ................................................................................................ 17
Table 8: Normalized Address Table ................................................................................................ 17
Table 9: Normalized Person Table................................................................................................... 17
Table 10: Normalized Student Table ............................................................................................... 18
Table 11: Normalized Instructor Table ............................................................................................ 18
Table 12: Normalized Course Table ................................................................................................ 18
Table 13: Normalized Specification Table ...................................................................................... 18
Table 14: Normalized Class Table ................................................................................................... 19
Table 15: Normalized Module Table ............................................................................................... 19
Table 16: Normalized StudentDetailsTable ..................................................................................... 19
Table 17: Normalized CourseDetailsTable ...................................................................................... 19
CS5051NP Database
1 Introduction
1.1 Introduction of the College
The ING Group's affiliate college, Informatics College Pokhara, was founded in 2011. It
began its academic career as a franchisee of Singapore-based Informatics Education
Limited. Since 2017, Informatics College Pokhara has worked directly with London
Metropolitan University in the United Kingdom to give students in Pokhara with an
exceptional higher education in IT and Business at a reasonable price.
The Ministry of Education in Nepal has certified all of the courses offered by
Informatics College Pokhara as equal to Tribhuvan University in Nepal. As a result,
graduates will be able to work for both public and private organizations across the
world. Furthermore, they have the option of applying for higher education at any
university in the globe. ICP is proud of its exceptional academics, cutting-edge facilities,
and resources that help their students throughout their academic careers. ICP also
aspires to produce graduates who will be sought after by businesses both domestically
and internationally. Furthermore, ICP guarantees that the support you receive from its
staff will be unrivaled and will assist you in achieving your objectives. Informatics
College Pokhara offers direct degrees in Information Technology and Business. The
courses are entirely designed and approved by the London Metropolitan University.
Informatics College Pokhara adopts the internationally practiced lecture-tutorial-
workshop methodology of teaching from the UK education system. This means that the
course delivery is more skill-driven and knowledge-oriented that primarily focuses on
self-learning and research. Students from Informatics College Pokhara get to travel to
Thailand in an all-expense-paid trip to participate in the 15-Day Summer Camp program
at the University of Thai Chamber of Commerce. Informatics College Pokhara offers
state-of-the-art academic and social facilities, to ensure that the students get the best
possible education and have an enjoyable time learning.
Academic Programs:
1. Bachelor’s Degree in Information Technology
BSc (Hons) Computing
2. Bachelors in Business Administration
BBA (International Business)
Page | 6
19031007
CS5051NP Database
19031078 Page | 7
CS5051NP Database
• To participate in the program, students must enroll in one of the required courses.
• Students are required to be familiar with and follow the University's rules and
regulations.
• Students should come to class prepared and on time, engage actively, and respect the
rights of other students to study.
• All students are expected to understand the objectives and purpose of the coursework
and exams and plan their respective studies accordingly.
• Students must submit their work on time, participate in feedback, and use that
information into their following exams.
• All students must provide their current and accurate contact and personal
information.
For Instructors:
• All teachers must dress appropriately for the occasion, as dictated by the institution; if
someone fails to do so, he or she will not be permitted to teach that day.
• All teachers should be available during their scheduled hours; in the event of an
emergency, an obligatory consent letter informing the cause three days in advance is
necessary.
• All employees should bring their identification, which they will provide to authorities
if an incident of interest occurs.
• All instructors must provide their current and accurate contact and personal
information.
19031078 Page | 8
CS5051NP Database
19031078 Page | 9
CS5051NP Database
• Student
Student entity is the list of details of student admitted students in the collage. The
attributes of students are StudentID (PK), EnrollDate and Marks.
19031078 Page | 10
CS5051NP Database
19031078 Page | 11
CS5051NP Database
3 Normalization
The practice of arranging the fields and tables of a relational database to reduce
redundancy and dependence is known as database normalization. Normalization is
breaking down huge tables into smaller (and less redundant) tables and establishing links
between them. The goal is to isolate data such that field additions, removals, and updates
may be done in a single table and then propagated across the database using established
relationships.
Table data can be normalized to remove redundancies and inconsistencies. It's the process
of condensing tables into a collection of columns in which all non-key columns are
dependent on the primary key column. If this is not the case, data changes may result in
inconsistencies.
Normalization rules are divided into following normal forms:
• Unnormalized Normal Form (UNF)
• First Normal Form (1NF)
• Second Normal Form (2NF)
• Third Normal Form (3NF)
Following assumptions were taken into consideration before normalizing:
• A college contains many courses.
• One student can enroll in only one course.
• One course can have any number of students.
• One course contains many specifications.
• One specification contains many modules.
• One module can fall under different specifications.
• One instructor can be associated only in one course.
• One instructor can be be leader of only one course.
• One instructor can teach many modules.
• One module can be taught by many instructors.
• For each course, there is a course leader.
• For each module there is a particular class.
• One class can be suitable for many modules.
19031078 Page | 12
CS5051NP Database
19031078 Page | 13
CS5051NP Database
Person entity serves as repeating data for Course entity, and Course entity serves as a
repeating group of Person table in this collage. As a result, a new table titled Course1
was created. One new table was created from the Person table in the first normal form,
resulting in two tables in the 1NF. The following are the 1NF's final tables:
Person1 (PersonID, PersonName, Age, PhoneNo, Gender, HouseNo, Street, City,
Province, Country, FaxNumber, StudentID, InstructorID, Salary, ClassID, ClassName)
For Person1 (PersonID, PersonName, Age, Gender, PhoneNo, HouseNo, Street, City,
Province, Country, FaxNumber, StudentID, InstructorID, Salary)
19031078 Page | 14
CS5051NP Database
Because such tables had partial dependencies, they were further split into new tables
based on the relationship between the composite key, main key, and non-keys. The
newly created tables are listed below, along with their associated characteristics.
Person-2 (PersonID, PersonName, Gender, Age, PhoneNumber, HouseNo, Street,
City, Province, Country, FaxNumber)
19031078 Page | 15
CS5051NP Database
Hence, a different table are formed after reducing the transitive dependency from 2NF.
List of the table formed is given below:
19031078 Page | 16
CS5051NP Database
Person
Age Not Null INT
19031078 Page | 17
CS5051NP Database
19031078 Page | 18
CS5051NP Database
19031078 Page | 19
CS5051NP Database
19031078 Page | 20
CS5051NP Database
6 Database Implementation
6.1 Table Generation
• Creation of User and Grant Privileges to User
19031078 Page | 21
CS5051NP Database
19031078 Page | 22
CS5051NP Database
19031078 Page | 23
CS5051NP Database
19031078 Page | 24
CS5051NP Database
19031078 Page | 25
CS5051NP Database
19031078 Page | 26
CS5051NP Database
19031078 Page | 27
CS5051NP Database
19031078 Page | 28
CS5051NP Database
19031078 Page | 29
CS5051NP Database
19031078 Page | 30
CS5051NP Database
7 Database Querying
7.1 Information Query
1. List all the students with all their addresses with their phone numbers.
19031078 Page | 31
CS5051NP Database
2. List all the modules which are taught by more than one instructor.
3. List the name of all the instructors whose name contains ‘s’ and salary is above 50,000.
19031078 Page | 32
CS5051NP Database
6. List the fax number of the instructor who teaches the ‘database’ module.
19031078 Page | 33
CS5051NP Database
9. List all the Instructors with all their addresses who have ‘a’ at the end of their names.
1. Show the students, course they enroll in and their fees. Reduce 10% of the fees if they are
enrolled in a computing course.
19031078 Page | 34
CS5051NP Database
2. 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.
3. Show the name of all the students with the number of weeks since they have enrolled in
the course.
4. Show the name of the instructors who got equal salary and work in the same specification.
19031078 Page | 35
CS5051NP Database
5. List all the courses with the total number of students enrolled course name and the highest
marks obtained.
19031078 Page | 36
CS5051NP Database
19031078 Page | 37
CS5051NP Database
19031078 Page | 38
CS5051NP Database
10 Conclusion
The aim of the coursework was to create a database system for a college. After
creating a database system we were also asked to retrieve data as requested in the
coursework. We were asked to show various information and transaction queries. I
choosed to maked a database system of my own college (ICP). Since I knew a lot of
things about ICP, the corusework didn’t became that hard to do. Initially before
starting the coursework, I had the mixed feeling of curiosity and fear. With the
previous knowledge on oracle database and SQL, I had the curiosity about how it can
be integrated in the applications because we had only learned to design and implement
the database in the terminal window in the third semester of the course. I thought it
would be very hard for me to adapt this programming language but with the
continuous guidance from the module leader and try outs, I found out that
programming in database is not hard as I thought.
This assignment was unlike any other Coursework I'd ever done before. But it was also
the most practical of the bunch. During this class, I had considerable difficulty running
queries. In SQL Plus, I also got a number of problems when generating and inserting
data. Some of the mistakes were caused by misspelled words or missing letters.
Because SQL plus was so easy to use, I was able to solve such issues. It displays the
error as well as the line number on which the mistake occurred. I had to go over my
lecture and tutorial slides several times in order to execute various queries.
Throughout this coursework, I gained a great deal of knowledge about how to preserve
and maintain a company's database system. I learnt how to obtain data from a database
using a variety of queries. I also learnt how to draw a relational diagram, how to
normalize tables, and how to enter data into a database. This seemed really practical to
me. This coursework was essential in providing us with practical understanding of
real-world scenarios. I learnt a lot of new stuff after completing the program that I
didn't know before.
19031078 Page | 39