Professional Documents
Culture Documents
CS5051NP
Coursework 1
Submitted BY Submitted To
Nikhil Thapa Mr. Pratibha Gurung
Group: C4 Module Leader
Date: 2020/12/18 Database
London Met. ID: 19031007
Table of Contents
1 Introduction ............................................................................................................................. 1
1.1 Introduction of the College .............................................................................................. 1
1.2 Current Business Activities and Operations .................................................................... 1
1.3 Current Business Rules .................................................................................................... 2
1.3.1 Identification of Entities and Attributes .................................................................... 3
1.3.2 Data dictionary before normalization ....................................................................... 3
2 Initial E-R Diagram ................................................................................................................. 6
3 Normalization .......................................................................................................................... 7
3.1 UNF .................................................................................................................................. 7
3.2 1NF ................................................................................................................................... 8
3.3 2NF ................................................................................................................................... 8
3.4 3NF ................................................................................................................................. 10
3.4.1 Data dictionary before normalization ..................................................................... 11
4 Final Entity Relation Diagram ............................................................................................... 15
5 Database Implementation ...................................................................................................... 16
5.1 Table Generation ............................................................................................................ 16
5.2 Populate DB tables ......................................................................................................... 23
5.3 Final Table...................................................................................................................... 27
6 Database Querying ................................................................................................................ 32
6.1 Information Query .......................................................................................................... 32
6.2 Transaction Query .......................................................................................................... 36
7 Screenshot of dump files ....................................................................................................... 40
8 Droping Tables ...................................................................................................................... 41
9 Conclusion ............................................................................................................................. 44
Table Of Figues
1 Introduction
1.1 Introduction of the College
Education is the most valuable tool to achieve success in one’s ife. Education is a life
long process. Education of a person begins from home. But a person can not learn
everything inside home. That is where school, collages, and universities comes. School
teaches basic things about a lot of things. College teaches about those things in more
detail. And finally university teachers us how are those things performed. In today’s date
if a person does not have a university certificate then he/she is restricted in a lot of line of
work. There are many colleges in any particular city. In my city Pokhara, Informatics
College Pokhara(ICP) is without any doubt one of best college to provide quality
education.
ICP, established in 2011 is an associate college of ING Group. As a franchisee of
Informatics Education Limited, Singapore, ICP began its academic journey. Informatics
College Pokhara has been directly collaborating with London Metropolitan University,
UK, since 2017 to provide students in Pokhara with enviable higher education in IT and
Business at an affordable price.
ICP provide two courses to choose for students:
1. BBA
Marketing
Business
Computing
Networking
Multimedia
Various activites and operations is performed in ICP college. They are as follow:
Library provides various learning materials and books.
Encouring students to take part in various programs.
Providing fresh environment for students.
Students are provided with classes with electricity and wifi acces.
Page | 1
19031007
CS5051NP Database
For Instructors:
A instructor can only be course leader of only one course.
Instructors should teach modules in a particular class.
Single instructor can teach multiple modules.
Instructors should attend college in proper uniform.
Page | 2
19031007
CS5051NP Database
Page | 3
19031007
CS5051NP Database
Page | 4
19031007
CS5051NP Database
Page | 5
19031007
CS5051NP Database
Page | 6
19031007
CS5051NP Database
3 Normalization
3.1 UNF
UNF stand for unnormalized form. In this form repeating and non repeating groups are
seperated. Repeating groups are separated by keeping them inside curly brackets {}.
Page | 7
19031007
CS5051NP Database
3.2 1NF
1NF stands for First Normal Form. The rules of 1NF is to separate repeating groups by
keeping them in a different list as shown below.
The 1NF table of ICP college is as follows:
Person (P_ID, P_FNAME, P_ FNAME, P_Age, P_Gender, P_Contact, P_Email,
P_HouseID, P_Street, P_City, P_Province, P_CountryName, P_fax, S_ID, S_DOJ,
S_Marks, I_ID, I_Salary, D_ID, D_Name, D_Type)
3.3 2NF
2NF stands for Second Normal Form. They key rule of 2NF is to remove partial
dependencies. Similarly it should also be in 1nf.
Person
Identifying PD:
P_ID -> P_ID P_FNAME, P_ FNAME, P_Age, P_Gender, P_Contact, P_Email,
P_HouseID, P_Street, P_City, P_Province, P_CountryName, P_fax
P_ID -> D_ID, D_Name, D_Type
Identifying FFD:
S_ID ->
I_ID ->
P_ID, S_ID -> S_DOJ, S_Marks
P_ID, I_ID -> I_Salary
Course
Page | 8
19031007
CS5051NP Database
Identifying PD:
C_ID -> C_Name, C_Cost, C_Leader, C_Duration, C_Credit
SP_ID -> SP_Name,
M_ID -> M_Name, M_Leader, M_Level, M_Duration, M_Credit, CL_ID,
CL_Name
Identifying FFD:
P_ID, C_ID, SP_ID, M_ID ->
C_ID, SP_ID, M_ID ->
Creating Tables :
Person (P_ID -> P_ID P_FNAME, P_ FNAME, P_Age, P_Gender, P_Contact, P_Email,
P_HouseID, P_Street, P_City, P_Province, P_CountryName, P_fax )
Departmet(P_ID, D_ID, D_Name, D_Type)
Student (P_ID, S_ID -> S_DOJ, S_Marks )
Instructor (P_ID, I_ID -> I_Salary )
Course (C_ID, C_Name, C_Cost, C_Leader, C_Duration, C_Credit)
Specification (SP_ID, SP_NAME)
Module (M_ID, M_Name, M_Leader, M_Level, M_Duration, M_Credit, CL_ID,
CL_Name)
CoueseInfo (P_ID, C_ID, SP_ID, M_ID)
CourseDetails (C_ID, SP_ID, M_ID)
Page | 9
19031007
CS5051NP Database
3.4 3NF
3NF stands for Third Normal Form. A table is said to be in 3NF if it is in 2NF and it
doesn’t have Transitive Dependencies.
Person
Identifying TD:
P_ID - > P_ID, P_ID P_FNAME, P_ FNAME, P_Age, P_Gender, P_Contact,
P_Email, P_ AddressID
P_AddressID -> P_HouseID, P_Street, P_City, P_Province, P_CountryID, P_fax
P_CountryID -> P_CountryName
P_ID -> AddressID-> CountryID
Module
Identifying TD:
M_ID -> CL_ID -> CL_Name
M_ID -> M_Name, M_Credit, CL_ID
CL_ID -> Cl_Name
Created Tables:
Page | 11
19031007
CS5051NP Database
Page | 12
19031007
CS5051NP Database
Page | 13
19031007
CS5051NP Database
Page | 14
19031007
CS5051NP Database
Page | 15
19031007
CS5051NP Database
5 Database Implementation
Creation of User
Page | 16
19031007
CS5051NP Database
Page | 17
19031007
CS5051NP Database
Page | 18
19031007
CS5051NP Database
Page | 19
19031007
CS5051NP Database
Page | 20
19031007
CS5051NP Database
Page | 21
19031007
CS5051NP Database
Page | 22
19031007
CS5051NP Database
Page | 23
19031007
CS5051NP Database
Page | 24
19031007
CS5051NP Database
Page | 25
19031007
CS5051NP Database
Page | 26
19031007
CS5051NP Database
Page | 27
19031007
CS5051NP Database
Page | 28
19031007
CS5051NP Database
Page | 29
19031007
CS5051NP Database
Page | 30
19031007
CS5051NP Database
Page | 31
19031007
CS5051NP Database
6 Database Querying
6.1 Information Query
1. List all the students with all their addresses with their phone numbers.
Page | 32
19031007
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.
Page | 33
19031007
CS5051NP Database
5. List the name of the head of modules with the list of his phone number.
Page | 34
19031007
CS5051NP Database
7. List the fax number of the instructor who teaches the ‘database’ module.
Page | 35
19031007
CS5051NP Database
10. List all the Instructors with all their addresses who have ‘a’ at the end of their first names.
Page | 36
19031007
CS5051NP Database
1. Show the students, course they enroll in and their fees. Reduce 10% of the fees if they
are enrolled in a computing course.
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.
Page | 37
19031007
CS5051NP Database
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.
Page | 38
19031007
CS5051NP Database
5. List all the courses with the total number of students enrolled course name and the
highest marks obtained.
Page | 39
19031007
CS5051NP Database
Page | 40
19031007
CS5051NP Database
8 Droping Tables
Page | 41
19031007
CS5051NP Database
Page | 42
19031007
CS5051NP Database
Page | 43
19031007
CS5051NP Database
9 Conclusion
This coursework was provied to us on week 7 . 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.
This coursework was completely new from all the coursework I’ve done before. But it was also a
lot more practical among them all. I had some problem with running quries during this
coursework. I also had a lot of errors when creating and inserting values in SQL plus. Some of
those errors were due to spelling errors or missing characters. I was able to fix such kind of
problems because SQL plus was very handy to use. It shows error and the line number of error.
For running verious queries I had to go through my lecture and tutorial slides multiple times. I
also had to watch various tutorials in youtube when I was confused on how to write queries. I
would like to thank my module leader and college for providing us with such quality learning
materials and reading environment even at such period of lockdown.
During this coursework I learned a lot of knowledge about keeping and maintaing a database
system of a organization. I learned to use a lot of queries to retrieve data from a database. I also
learned to make relatonal diagram, normalize the tables and insert the values in a database. This
felt so much practical to me. This coursework played a huge role on giving us all students
pratical knowledge of real world scenario. After finishing the coursework I learned a lot of new
things which I didn’t knew before starting it.
Page | 44
19031007