Professional Documents
Culture Documents
What is Database?
You can organize data into tables, rows, columns, and index it to
make it easier to find relevant information.
1. MySQL,
2. Sybase,
3. Oracle,
4. Mongo DB,
5. Informix,
It is used for storing data and retrieving the data effectively when
it is needed. It also provides proper security measures for protecting the
data from unauthorized access.
1. DATABASE CONCEPTS
1.1 Introduction
A database is an organized collection of data.
The data are typically organized to model relevant aspects of reality in a
way that supports processes requiring this information.
It is an electronic storage of data.
It stores information and relationship among different things.
Data:
The facts describing an entity are known as data. Example: For a
Customer, custno, custname, address…, etc., are maintained in a register
which describes the characteristics of the entity Customer.
CUSTNO CUSTNAME ADDRESS
1 A X
2 B Y
3 C Z
Attributes:
Each entity can be described by its characteristics, which are
known as attributes.
Example: For a Student, name, regno, class, address etc….
Entity Set:
All the related entities are collected together to form an entity set.
An entity set is given a singular noun.
Example: The student entity set contains data about student only.
All related entity in the STUDENT entity set is student. Similarly a
company keeps track all of its employees is an entity set called
EMPLOYEES. The EMPLOYEE entity set does not contain about the
company’s customers, because it would not make any sense.
Database:
A database is a collection of entity sets.
Example: A college database may include entities such as student,
faculty, course, term, office, building, exam etc., the entities in a database
are likely to interact with other entities.
Relationship:
The interactions between the entity sets are called relationship.
Example: A faculty member teaches in a college, so the relationship
between FACULTY and COLLEGE is teaches.
1.2 Relationship
The interactions between the entity sets are called relationship.
Types of Relationships
The database design requires creating various entity sets and establishing
the relationship between the entity sets within the database. The different
database management software packages handle the creation and use of
relationship in different manners. Depending upon the type on interaction, the
relationship is classified in to three categories.
1. One –to-one relationship:
A one-to-one relationship is written as 1:1 in short form.
It exists between two entity sets X and Y. If an entity set X has only one
matching entity in entity set Y, and vice versa.
Example: A College has one Principal. A Department is led by one
Head.
2. One-to-Many relationship:
A one-to-one relationship is written as 1:M in short form.
It exists between two entity sets X and Y. If an entity in entity set X has
many matching entities in entity set Y, but an entity in entity set Y has only one
matching entity in entity set X.
Example: A faculty teaches to Many Students of a class room, but the
students had a relationship with one faculty member.
3. Many-to-Many relationship:
It also write in M:N (or) M:M
It exists of two entity set X and Y. If an entity in entity set X has many
matching entities in entity set Y and an entity in entity set Y has many matching
entities in entity set X.
Example: Many Courses availed for Many Students.
1. Does an entity in entity set X have more than one matching entity in entity set Y?
2. Does an entity in entity set Y have more than one matching entity in entity set X?
The answer for both the questions is NO, and then the relationship lies in 1:1
The answer for the first question is Yes and second question is NO, then the
relationship lies in 1:M
The answer for both the questions is Yes, then the relationship lies in M:M (or)
M:N