Table of Contents
Chapter 1: Introduction to Database                              1
  1.1       Background                                           1
Chapter 2: Introduction to College Management System             3
  2.1 Introduction                                               3
Chapter 3: ER Diagram of College Management System               4
  3.1 College Management System entities and their attributes:   4
  3.2 ER diagram of College Management System:                   5
Chapter 4: Structure Query Language                              6
  4.1 Introduction to SQL                                        6
  4.2 SQL Command                                                6
    4.2.1 Data Definition Language (DDL)                         6
        Alter command                                            17
    4.2.2 Data Manipulation Language (DML)                       19
    4.2.3 Data Query Language (DQL)                              26
Chapter 5     Normalization                                      31
  5.1 Introduction                                               31
  5.2 First Normal form                                          31
  5.3 Second Normal Form                                         31
  5.4 Third Normal Form                                          32
Chapter 1: Introduction to Database
1.1 Background
A database is a collection of related information that is organized so that accessing, managing,
and updating information can be easily done by the user. In other words, a database is the
collection of interrelated information in particular subject matter organized in a useful manner
that aids in data manipulation. For example, a database of college management systems which
records all the related information such as students, departments, courses, exams, teachers,
salary and so on.
Database Management System (DBMS) is the system software that manages data in a database.
It is the interface between database and end users through which the user interacts with the
database and helps in data manipulation such as create, update, and manage. The main goal of
DBMS is to hide the underlying complexities of data management from the users and provide
easy user experience. Examples: MS Access, MySQL Server, Oracle etc.
There are different features of DBMS. They are:
   ● Data Structuring: All information in a digital repository is organized into a clear
     hierarchical structure with records, tables, or objects.
   ● Database Customization: Along with default and necessary elements (records, tables,
     or objects) that compose a database structure, there can be created custom elements that
     meet specific needs of users.
   ● Database retrieval: DBMS accepts data input from users and stores it. Users can
     access the database later to retrieve their records as a file, printed, or viewed on the
     screen.
   ● Query languages: A typical DBMS makes it possible to use query languages for
     collecting, searching, sorting, modifying and other activities that help users manipulate
     their records in the database.
   ● Multi-user access: DBMS provides multiple user's access to all types of information
     stored in one and the same data store. There is also a security feature that prevents some
     users from viewing and/or modifying certain data types.
   ● Data Integrity: All information in a database is accessible by several or more users but
     only authorized users can change the same piece of data at a time and changes are to be
     made in only one place. This capability lets prevent database corruptions and failure.
   ● Easiness in database: DBMS enables data management because it provides users with
     simple yet powerful tools to enter changes and export business data. DBMS also
     reduces the reliance of individual users on computer specialists and programmers to
     meet their specific needs through data customization.
                                                                                              1
       ● Reduced data redundancy: A DBMS reduces the duplication of data from a database
         which helps businesses to use the same data over and again without repeating the same
         data over and again.
       ● File consistency: Using DBMS, problems that occur from traditional file processing
         systems can be overcome. This makes the business data easier to manipulate and
         maintain. Consistency across data files and computer programs also makes it easier to
         set and customize business records when multiple programmers are involved.
A database model is a type of data model that determines the logical structure of a database
and fundamentally determines in which manner data can be stored, organized, and manipulated.
There are various models of database which are explained below:
  I.      Hierarchical model: It is the oldest type of database model that organizes data into a
          tree- like structure, where each record has a single parent or root but can have several
          children. The data is stored and sorted as records which are connected to one another
          through links. It is good for describing many real-world relationships.
 II.      Network model: It is the extension of hierarchical model that facilitates many-to-many
          relationships. Entities are organized in a graph, in which some entities can be accessed
          through several paths. Each record has multiple fields, and each field has only one data
          value.
III.      Relational model: The most common model, the relational model sort’s data into
          tables, also known as relations, each of which consists of columns and rows. The tables
          or relations are related to each other. Each row, also called a tuple, includes data about
          a specific instance of the entity in question, such as a particular student. Example:
          Oracle, SQL, MS-Access, MySQL, etc.
IV.       Entity-Relationship(E-R) model: ER model captures the relationship between real-
          world entities much like network model but it is not as directly tied with physical
          structure of the database. It is often used to design databases conceptually. ER-Diagram
          is a visual representation of data that describes how data is related to each.
 V.       Object-Oriented model: It defines a database as a collection of objects, or reusable
          software elements, with associated features and methods.
VI.       Physical model: It defines all the relational data models and objects of the database. It
          is created using the native database language. It can also be created by transforming the
          logical model
                                                                                                  2
Chapter 2: Introduction to College Management System
2.1 Introduction
A college management system is the software designed for the management of college through which
all the information regarding students, teachers, courses, exam etc. can be retrieved quickly and
efficiently. This project aims to simplify the job of managing the record of students, teachers, courses
etc. To develop the well-designed database, we must select a suitable database model along with
proper allocation of storage.
College Management System does following things:
    ● Departments: This table contains the information about departments like department-
      id, department name, location, and phone number.
    ● Students: This table will store the data’s that are related to students like student-id,
      mobile no, name, address. Each student will be given a unique id that will help
      management to identify students.
    ● Courses: This table will store different information related to courses that will be
      provided to students like course-id, course name, course -type.
    ● Subjects: This table will give us the information about subjects that are being taught in
      the colleges. Each subject is with a different id.
    ● Teachers: This table will give information about the teacher id, name, gender and the
      subject he teaches.
    ● Attendance: This table will record all the data that is related to the attendance of the
      student. Absent days and present days are also recorded.
    ● Result: This table will store the data like Result-id, subject-id, student-id, marks
      obtained in subject and so on.
    ● Exam: All the information related to exams are stored in this table. It consists of exam-
      id, exam type, subject name and so on.
                                                                                                      3
Chapter 3: ER Diagram of College Management System
This ER diagram represents the model of college management system. The entity-relationship
diagram of college management system shows all the visual instrument of database tables and
the relationship between Students, Department, Teachers, Courses, Exam and so on.
3.1 College Management System entities and their attributes:
   ● Student Entity: Attribute of student entity are std-id, std-name, age, gender, address,
     contact, email, dob.
   ● Department Entity: Attributes of department are dept-id, dept-name.
   ● Course Entity: Attribute of courses are c-id, c-name, duration, credit-hour.
   ● Subject Entity: Attribute of subject are sub-id, sub-name, sub-code.
   ● Teacher Entity: Attribute of teacher are t-id, t-name, contact, email, gender, salary,
     address.
   ● Attendance Entity: Attribute of attendance are status, present-day, absent-day, leave-
     day, calendar.
   ● Exam Entity: Attribute of exam are exam-id, exam-name, exam-type.
   ● Result Entity: Attribute of result are gpa, grade, sub-name.
   ● Classroom Entity: Attribute of classroom are room-id, class-name, section.
                                                                                          4
3.2 ER diagram of College Management System:
                     Fig: College Management System
                                                      5
Chapter 4: Structure Query Language
4.1 Introduction to SQL
Structure Query Language (SQL) is a programming language used for storing and managing
data in RDBMS. SQL was the first commercial language introduced for E.F
Codd’s Relational model. Today almost all RDBMS (MySQL, Oracle, Info mix, MS Access)
uses SQL as the standard database language. SQL is used to perform all type of data operations
in RDBMS.
4.2 SQL Command
SQL defines following data languages to manipulate data of RDBMS.
  ● Data Definition Language (DDL)
  ● Data Manipulation Language (DML)
  ● Data Query Language (DQL)
4.2.1 Data Definition Language (DDL)
DDL is the part of SQL that allows database users to create and restructure database objects.
A database schema is specified by a set of definitions expressed by a special language called
data definition language. So, data definition language is a set of SQL commands which is used
to create, modify and delete database structure but not data.
 The main tasks of DDL are:
    ● Creating database object like tables.
    ● Modifying database objects.
    ● Destroying database objects.
DDL also updates a special set of tables called the data dictionary. The result of compilation
of DDL statement is a set of tables that is stored in special files called data dictionary. A data
dictionary contains metadata i.e., data of data. Data about structure of a database is called
metadata.
Creating a Database
To create a database in RDBMS, create command is used. Syntax:
CREATE database database_name;
use database_name;
                                                                                                6
Creating a Table
create command is also used to create a table. We can specify names and data types of various
columns along. Following is the Syntax,
CREATE table table-name
{
Column_name1 datatype1,
Column_name2 datatype2,
Column_name3 datatype3,
Column_name4 datatype4
};
Creating table Student
We create table inventory using CREATE command and define the data types of its attribute
and its constraints as shown below:
Creating table Teacher
We create table goods using CREATE command and define the data types of its attribute and
its constraints as shown below:
                                                                                           7
Create table Teacher Subject
Create table Sub-teacher Exam
                                8
Create table Subject
                       9
Create table Teacher Room
Create table Teacher Attendance
                                  10
Create table Student-Exam
Create table Student Attendance
                                  11
Create table Student Address
Create table Result
                               12
Create table Permanent Address
Create table Faculty
                                 13
Create table Exam
Create table Department
                          14
Create table Current Address
Create table Courses
                               15
Create table Course Subject
Create table Classroom
                              16
Show table
The lists of tables are shown below:
Alter command
Alter command is used for alteration of table structures. There are various uses
of alter command such as:
     ● to add a column to existing table
     ● to rename any existing column
     ● to change datatype of any column or to modify its size.
     ● alter is also used to drop a column.
To Add Column to existing Table
Using alter command we can add a column to an existing table.Syntax,
ALTER table table_name add (column_name datatype);
Using alter command we can even add multiple columns to an existing table. Syntax,
ALTER table table_name add (column_name1 datatype1, column_name2 datatype2,
column_name3 datatype3);
Alter command can add a new column to an existing table with default values. Syntax,
ALTER table table_name add (column_name1 datatype1 default data);
                                                                                       17
In this example contact column is added.
In this example contact column is modified.
In this example contact column is drop.
In this example result table is drop.
                                              18
4.2.2 Data Manipulation Language (DML)
Data Manipulation Language (DML) statements are used for managing data in database. DML
commands are not auto-committed. It means changes made by DML command are not
permanent to database, it can be rolled back. DML is used to insert the domain values, update
or modify the domain values and delete or remove the domain values.
Common DML commands are:
    ● INSERT
    ● UPDATE
    ● DELETE
INSERT command
Insert command is used to insert data into a table. Following is its general syntax,
INSERT into table_name values (data1, data2…);
Inserting values in table Students:
Inserting values into teachers:
                                                                                          19
Inserting values into Subjects:
Inserting values into Departments:
                                     20
Inserting values into Student Address:
Inserting values into Current Address:
                                         21
Inserting values into Permanent Address:
Inserting values into Student Attendance:
                                            22
Inserting into Student Exam:
Inserting into Teacher Attendance:
                                     23
Inserting into Teacher Room:
Inserting into Teacher Subject:
                                  24
Inserting into Result:
UPDATE command
Update command is used to update a row of a table. Following is its general syntax,
UPDATE table_name set column-name = value where condition;
Delete command
Delete command is used to delete data from a table. Delete command can also be used with
condition to delete a particular row. Syntax,
DELETE from table_name where condition;
                                                                                           25
4.2.3 Data Query Language (DQL)
DQL is used to retrieve or extract the information from database. It includes three commands:
    ● SELECT: It is used for selecting the column name.
    ● FROM: It is used to define rational table name.
    ● WHERE: It is used to define condition(s).
SELECT Query
Select query is used to retrieve data from tables. It is the most used SQL query. We can retrieve
complete tables, or partial by mentioning conditions using WHERE clause.
Syntax of SELECT Query:
SELECT column_name1, column_name2, … column_nameN
FROM table_name
WHERE condition(s);
Wildcard operators
There are four wildcard operators but only two of them are used in like clause.
 Wildcard                                        Description
 %(Percent)                                      Represent any string of zero or more characters
 _(Underscore)                                   Represent any single character
 []                                              Represent any single character within
                                                 specified range
 [^]                                             Represent any single character not within the
                                                 specified range
In this example wild card operator is used to print the name of students starting from ‘s’.
                                                                                              26
In this example all the students whose name ends with ‘a’ are displayed using wild card
operator.
SQL Functions
SQL provides many built-in functions to perform operations on data. These functions are useful
whileperforming mathematical calculations, string concatenations, sub-strings etc. SQL
functions are divided into two catagories:
   ● Aggregrate Functions
   ● Scalar Functions
Aggregrate Functions
These functions return a single value after calculating from a group of values.Following are
some frequently used Aggregrate functions.
   1. AVG()
      Average returns average value after calculating from values in a numeric column.
      Its general Syntax is:
      SELECT AVG(column_name) from table_name;
   2. COUNT()
      Count returns the number of rows present in the table either based on some condition
      or without condition.
      Its general Syntax is:
      SELECT COUNT(column_name) from table_name;
   3. MAX()
      MAX function returns maximum value from selected column of the table.
      Syntax of MAX function is:
      SELECT MAX(column_name) from table_name;
   4. MIN()
      MIN function returns minimum value from a selected column of the table.
      Syntax for MIN function is:
      SELECT MIN(column_name) from table_name;
                                                                                           27
5. SUM()
   SUM function returns total sum of a selected columns numeric values.
   Syntax for SUM is:
   SELECT SUM(column_name) from table_name;
   In this example use of sum() is shown:
   In this example use of avg() is shown:
   In this example use of max() is shown:
                                                                          28
       In this example select concat is shown:
Join in SQL
SQL Join is used to fetch data from two or more tables, which is joined to appear as single set
of data. SQL Join is used for combining column from two or more tables by using values
common to both tables. JoinKeyword is used in SQL queries for joining two or more tables.
Minimum required condition for joining table, is (n-1) where n, is number of tables. A table
can also join to itself known as, Self Join.
Types of Join
The following are the types of JOIN that we can use in SQL:
    ● Inner
    ● Outer
    ● Left
    ● Right
INNER Join or EQUI Join
This is a simple JOIN in which the result is based on matched data as per the equality condition
specified in the query.
Inner Join Syntax is:
SELECT column_name_list
from table_name1
INNER JOIN
table-name2
WHERE table_name1.column_name = table_name2.column_name;
                                                                                             29
SQL Alias
Alias is used to give an alias name to a table or a column. This is quite useful in case of large
or complex queries. Alias is mainly used for giving a short alias name for a column or a table
with complex names.
Syntax of Alias for table names:
SELECT column_name
from table_name
as alias_name;
Alias syntax for columns will be like:
SELECT column_name as alias-name
From table_name;
                                                                                              30
                               Chapter 5 Normalization
5.1 Introduction
Normalization. Normalization is the technique of organizing the data into multiple related
tables to minimize the data redundancy. Unnecessary data repetition increases the size of data
and leads to many more problems. So, normalization help us to reduce data redundancies and
help us to tackle anomalies There are three normal form that are in use to eliminate data
redundancies. They are:
a) First Normal Form (1NF)
b) Second Normal form (2NF)
c) Third Normal Form (3NF)
d) Boyce- Codd normal form (BCNF)
From database point of view third normal form is the best way of normalization followed by
second normal form and first Normal form.
5.2 First Normal form
According to the first normal form, the attribute of a table cannot hold a value more than one.
The value should be in atomic form i.e. should contain only one value.
Let us consider the following example.
             Roll-no                          Std-name                               Subject
                1                             Surendra                             Php, math
                2                             prashant                              C++, java
                3                               anjan                                  C++
The table above is not in 1NF. It can be converted to 1nf in the following way .
             Roll-no                          Std-name                              Subject
                1                             Surendra                               Php
                1                             Surendra                               math
                2                             prashant                                C++
                2                             prashant                               java
                3                               anjan                                 C++
5.3 Second Normal Form
For a table to be in a 2nf, it should satisfy the following conditions:
            a) The table should be in 1nf.
            b) There should not be the partial dependency.
                                                                                                31
Let us suppose the student table:
     Score_id             Std_id             Sub_id              Marks              Teacher
        1                   10                 1                  72                  Ram
        2                   10                 2                  70                 Shyam
        3                   11                 1                  85                  Ram
        4                   11                 2                  80                 Shyam
        5                   11                 4                  90                  Hari
Here there is a partial dependency since the subset of the candidate key determines the nonprime
attribute.
This problem can be solved in many ways.one of them is given below. Here we separate the teacher
attribute from the score table.
Score table:
     Score_id             Std_id             Sub_id              Marks
        1                   10                 1                  72
        2                   10                 2                  70
        3                   11                 1                  85
        4                   11                 2                  80
        5                   11                 4                  90
Teachers table:
               Sub_id                         Teacher
                 1                              Ram
                 2                             Shyam
                  4                             Hari
5.4 Third Normal Form
For a table to be in a 3NF, it should satisfy the following conditions:
    a) The table should be in the 2NF.
    b) There should not be transitive dependency.
In simple terms, transitive dependency refers to the condition where a non-key attribute
determines another non key attribute.
                                                                                                   32
Let us consider a table:
      Std_id             Name             Sub            Sub_id            Teacher
         1               Sabin            Php             101                X
         2             Surendra          Java             102                Y
         3             Prashant          Web              103                X
         4               anjan           dbms             104                 Z
 Here, teacher is functionally dependent in sub_id and sub_id is dependent on std_id. This
states that teacher is functionally dependent on std_id due to transitivity.
Subject table:
       Sub_id                 Sub                Teacher
        101                   Php                  X
        102                  Java                  Y
        103                  Web                   X
        104                  Dbms                   Z
Student table:
       Std_id               Name                  Sub_id
         1                  Sabin                  101
         2                 Surendra                102
         3                 Prashant                103
         4                  anjan                  104
                                                                                             33
Conclusion
In conclusion, the College Management System developed for this Database Management
System project is an important accomplishment that showcases my technical skills and
knowledge in the field of educational technology. This system has been designed to offer
college administrators a user-friendly and secure platform for managing student records,
faculty details, and course schedules. With its robust security features and ability to generate
insightful reports, this system has the potential to streamline administrative processes and
improve the overall efficiency of college management. I am proud of what I have achieved
through this project. I am grateful for the opportunity to develop my skills and knowledge
through this project, and I hope that you find this report to be a satisfactory demonstration of
my learning and achievements.
                                                                                              34