DBMS Project Report BIM TU
DBMS Project Report BIM TU
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.
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.
● 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.
● Teacher Entity: Attribute of teacher are t-id, t-name, contact, email, gender, salary,
address.
4
3.2 ER diagram of College Management System:
5
Chapter 4: Structure Query Language
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,
7
Create table Teacher Subject
8
Create table Subject
9
Create table Teacher Room
10
Create table Student-Exam
11
Create table Student Address
12
Create table Permanent Address
13
Create table Exam
14
Create table Current Address
15
Create table Course Subject
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.
17
In this example contact column is added.
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…);
19
Inserting values into Subjects:
20
Inserting values into Student Address:
21
Inserting values into Permanent Address:
22
Inserting into Student Exam:
23
Inserting into Teacher Room:
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.
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;
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
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;
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.
The table above is not in 1NF. It can be converted to 1nf in the following way .
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:
Teachers table:
Sub_id Teacher
1 Ram
2 Shyam
4 Hari
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