Relational Database Management System
Contents
Introduction
Objectives:
• To know about a relational database
• Creation, Maintenance of Relational Database Management System (RDBMS)
• To know about relation in a relational database Model
• Understand the creation and use of two different entities
Introduction:
Database is a collection of Data. DBMS is Data Base Management System which is a software
system that helps in creating, searching, arranging the data in database.
Relational Database is a collection of Data in the form of tables used to assemble or reassemble
the data easily. All the data are brought together to a single server connected together to a single
administrator. The administrator can provide privileges to various users and also data allocation
in the database can also be possible.
A method for structuring data in the form of sets of records or tuples so that relations between
different entities and attributes can be used for data access and transformation.( Burroughs,
1986)
Relational Database Management System – a database system made up of files with data
elements in two-dimensional array (rows and columns). This database management system has
the capability to recombine data elements to form different relations resulting in a great
flexibility of data usage.(Martin, 1976)
Relational Database Management System:
It consists of rows and columns to store the data. Tuple is called as row and Attribute is
called as Column. This system proved to be highly useful in the production industry for
recording data of new incomes and parts. Generally the transactions of money for banks and
other online money transactions are done through Relational database management systems
coordinated along with a mainframe server to function promptly with high frequencies that there
is almost no delay between processes. This system also can give privileges to specific users and
restriction of data access to users and these are all controlled by the administrator of the main
server.
For example: Let us now consider a table of Students(sno,Name,Age,Marks) where students is
the table and sno, Name, Age, Marks are attributes. sno is the primary key. The primary key is
the attribute that is used to point at any data in the table. Each and every data in this attribute will
have to be unique and only then the attribute will be identified as a primary key by the system. If
the above condition fails, then error in the table will be displayed and no changes to the data will
be made.
SNO NAME AGE MARKS
121 X 21 100
122 Y 20 91
123 Z 21 90
124 T 22 100
Primary key is unique foe each rows/tuple.
Maintenance of Relational Database Management System (RDBMS):
Let us have a new table with Courses(Name, Grade, Average, SSNO) where Courses is the table
and Name, Grade, Average, SSO are attributes. SSNO is the foreign key. In this table, the
foreign key is used to switch between tables. The foreign key is compared with the primary key
in the Student table and data can be extracted and combined with both the tables using the single
foreign key. This mainly came into existence because very long table with a lot of attributes
cannot be managed. In order to make this process of data entry and verification shorter and
easier, the table can be split up into a number of small individual tables linked using the foreign
key to connect with the main mother table. Hence using this method data entry and extraction
became easier.
Courses (Name, Grade, Average, SSNO)
The following table shows the serial number of the student, Name, Grade and the average marks.
SSNO NAME GRADE AVERAGE
121 Dance A 93.2
122 Music A 90.1
123 Vocal B 91.2
124 Dance C 91.4
Students (sno, Name, Age, Marks)
The following table shows the serial number, Name age and the marks of the student.
SNO NAME AGE MARKS
121 X 21 100
122 Y 20 91
123 Z 21 90
124 T 22 100
Foreign key is used to reference sno in students table. This is how the relations are maintained in
Relational Database Management System.
In software systems SQL are used to select a specific data from multiple tables.
Example : CREATE TABLE :Create a new table, e.g., students, courses, enrolled
SELECT-FROM-WHERE :List all courses
INSERT :Add a new student, course, or enroll a student in a course
Relation in Relational Database Management System (RDBMS):
Any relational database management system must follow the codd’s 12 rules. Generally a simple
Entity Relationship (ER) diagram is used to show the relationship between attributes in tables.
Such attributes can be basically classified based on their relationship with each other as the
following
1. One to Many and Many to One
2. Many to Many
3. One to One
One-to-many and many-to-one relationships
Let us consider an employee working in a company. An employee could work for one
department but a department can have many employees. So in a table when one attribute matches
another unique single data in the attribute, and that unique single data can have many data in
another attribute. This is known as one to many and many to one relationship. The following
tables can show a better example of the processes.
To define tables for each one-to-many and each many-to-one relationship:
1. Group all the relationships for which the "many" side of the relationship is the same
entity.
2. Define a single table for all the relationships in the group.
In the following example, the "many" side of the first and second relationships is "employees" so
an employee table, EMPLOYEE, is defined.
Entity Relationship Entity
Employees are assigned to departments
Employees work at jobs
Departments report to (administrative) departments
In the third relationship, "departments" is on the "many" side, so a department table,
DEPARTMENT, is defined.
The following tables show these different relationships.
The EMPLOYEE table:
The following table consists of the employee number, working department and their
corresponding Job.
EMPNO WORKDEPT JOB
000010 A00 President
000020 B01 Manager
000120 A00 Clerk
000130 C01 Analyst
000030 C01 Manager
000140 C01 Analyst
000170 D11 Designer
The DEPARTMENT table:
The following table consists of the department number and the administrative department
DEPTNO ADMRDEPT
C01 A00
D01 A00
D11 D01
Many-to-many relationships
A relationship that is multi-valued in both directions is a many-to-many relationship. Let
us now consider a company in which employees work. Let us assume that an employee can work
on more than one project, and a project can have more than one employee. So a project can have
many employees and an employee can have many projects. A many-to-many relationship can be
expressed in a table with a column for each entity ("employees" and "projects"), as shown in the
following example.
The following table shows how a many-to-many relationship (an employee can work on
many projects, and a project can have many employees working on it) is represented.
The employee activity (EMP_ACT) table:
The following table consists of the employee number and project number
EMPNO PROJNO
000030 IF1000
000030 IF2000
000130 IF1000
000140 IF2000
000250 AD3112
One-to-one relationships
One-to-one relationships are single-valued in both directions. Let us consider a company
has several departments and a manager for each. The manager can be used to denote a specific
department in a company and similarly the department manager specifies only that specific
person who is a manager. The relationship can be assigned to either the DEPARTMENT table or
the EMPLOYEE table. Because all departments have managers, but not all employees are
managers, it is most logical to add the manager to the DEPARTMENT table, as shown in the
following example.
The following table shows the representation of a one-to-one relationship.
The DEPARTMENT table:
The following table consists of the department number and the manager number.
DEPTNO MGRNO
A00 000010
B01 000020
D11 000060
Ensure that equal values represent the same entity
You can have more than one table describing the attributes of the same set of entities. For
example, the EMPLOYEE table shows the number of the department to which an employee is
assigned, and the DEPARTMENT table shows which manager is assigned to each department
number. To retrieve both sets of attributes simultaneously, you can join the two tables on the
matching columns, as shown in the following example. The values in WORKDEPT and
DEPTNO represent the same entity, and represent a join path between the DEPARTMENT and
EMPLOYEE tables.
The DEPARTMENT table:
The following table consists of the department number, department name, manager number and
the administrative department.
DEPTNO DEPTNAME MGRNO ADMRDEPT
D21 Administration 000070 D01
Support
The EMPLOYEE table:
The following table consists of the employee number, first and last names, working department
and the job in the company.
EMPNO FIRSTNAME LASTNAME WORKDEPT JOB
000250 Daniel Smith D21 Clerk
Conclusion:
Hence an overall study of RDBMS was conducted and the various data creation
procedures were studied in detail. Details and detailed maintenance procedures of a relational
database management system is also studied. Finally a better approach towards understanding
the relationship models were done and explained using examples for the individual cases with
individual tables.
References
Finkelstein.S.Schkolnick M. Tiberio P.. Physical Database Design For Relational Databases.
IBM Almaden Research Center
Abdelsalam M. Akhtar A. and Nick R. A Framework for Relational Database Migration.
Agrawal R. Kiernan J. Watermarking Relational Databases. IBM Almaden Research Center 650
Harry Road, San Jose, CA 95120.