Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

DBMS stands for Database Management System.

We can break it like this


DBMS = Database + Management System. Database is a collection of data and
Management System is a set of programs to store and retrieve those data.
Based on this we can define DBMS like this: DBMS is a collection of inter-
related data and set of programs to store & access those data in an easy andn
effective manner.
Applications where we use Database Management Systems are: Telecom,
banking system, industry, sales, Airlines, Education sector, Online Shopping

DATABASE CONCEPTS
 Database Concepts: Introduction to database concepts and its
need.
 Relational data model: Concept of domain, relation, tuple, attribute,
degree, cardinality, key, primary key, candidate key, alternate key
and foreign key;

The database concepts is a major part of study for


the testers, because data storage and processing is
one the important requirement from the client. The
information has to be stored in every organisation. e.g.:
Banks, library, flight companies, hospitals, universities
etc. The information is stored for the future reference.

The relational model is the theoretical basis of relational


databases, which is a technique or way of structuring data using
relations, which are grid-like mathematical structures consisting of
columns and rows.Relational data model is the primary data model,
which is used widely around the world for data storage and processing.
This model is simple and it has all the properties and capabilities
required to process data with storage efficiency.

In the relational model, all data is logically structured within


relations, i.e., tables, as mentioned above. Each relation has a name
and is formed from named attributes or columns of data. Each tuple or
row holds one value per attribute.
Tables − In relational data model, relations are saved in the format of
Tables. This format stores the relation among entities. A table has rows
and columns, where rows represents records and columns represent
the attributes.

Concepts

 Relation: A relation is a table with columns and rows.


 Attribute: An attribute is a named column of a relation.
 Domain: A domain is the set of allowable values for one or more
attributes.
 Tuple: A tuple is a row of a relation.
 Degree:- The number of attributes(Columns ) in a Table.
 Cardinality:- The number of tuples(Rows) in a Table.

Constraints
Every relation has some conditions that must hold for it to be a valid
relation. These conditions are called Relational Integrity Constraints.
There are three main integrity constraints −

 Key constraints
 Domain constraints
 Referential integrity constraints
Key Constraints
There must be at least one minimal subset of attributes in the
relation, which can identify a tuple uniquely. This minimal subset of
attributes is called key for that relation. If there are more than one such
minimal subsets, these are called candidate keys.
Key constraints force that −
 in a relation with a key attribute, no two tuples can have identical
values for key attributes.
 a key attribute can not have NULL values.
Key constraints are also referred to as Entity Constraints.
Domain Constraints
Attributes have specific values in real-world scenario. For
example, age can only be a positive integer. The same constraints have
been tried to employ on the attributes of a relation. Every attribute is
bound to have a specific range of values. For example, age cannot be
less than zero and telephone numbers cannot contain a digit outside 0-
9.
Referential integrity Constraints
Referential integrity constraints work on the concept of Foreign
Keys. A foreign key is a key attribute of a relation that can be referred in
other relation.
Referential integrity constraint states that if a relation refers to a key
attribute of a different or same relation, then that key element must
exist.
Applications where we use Database Management Systems
are:Telecom,banking system, industry, sales, Airlines, Education sector, Online
Shopping.
RELATIONAL MODEL (RM) represents the database as a collection of relations.
A relation is nothing but a table of values. Every row in the table represents a
collection of related data values. These rows in the table denote a real-world
entity or relationship.The table name and column names are helpful to
interpret the meaning of values in each row. The data are represented as a set
of relations. In the relational model, data are stored as tables. However, the
physical storage of the data is independent of the way the data are logically
organized.
Some popular Relational Database management systems are:
DB2 and Informix Dynamic Server – IBM, Oracle and RDB – Oracle,SQL Server
and Access – Microsoft

Relational Model Concepts

1. Attribute: Each column in a Table. Attributes are the properties


which define a relation. e.g., Student_Rollno, NAME,etc.
2. Tables – In the Relational model the, relations are saved in the
table format. It is stored along with its entities. A table has two
properties rows and columns. Rows represent records and
columns represent attributes.
3. Tuple – It is nothing but a single row of a table, which contains a
single record.
4. Relation Schema: A relation schema represents the name of the
relation with its attributes.
5. Degree: The total number of attributes which in the relation is
called the degree of the relation.
6. Cardinality: Total number of rows present in the Table.
7. Column: The column represents the set of values for a specific
attribute.
8. Relation instance – Relation instance is a finite set of tuples in
the system. Relation instances never have duplicate tuples.
9. Relation key - Every row has one, two or multiple attributes, which
is called relation key.
10. Attribute domain – Every attribute has some pre-defined
value and scope which is known as attribute domain

11. Relational Integrity constraints:-Relational Integrity


constraints is referred to conditions which must be present for a
valid relation. These integrity constraints are derived from the rules
in the mini-world that the database represents.
12. Key constraints:-An attribute that can uniquely identify a tuple in a
relation is called the key of the table. The value of the attribute for
different tuples in the relation has to be unique.

Example:In the given table, CustomerID is a key attribute of Customer


Table. It is most likely to have a single key for one customer, CustomerID
=1 is only for the CustomerName =" Google".

CustomerID CustomerName Status


1 Google Active
2 Amazon Active
3 Apple Inactive

Referential integrity constraints:-Referential integrity constraints is base on


the concept of Foreign Keys. A foreign key is an important attribute of a
relation which should be referred to in other relationships. Referential integrity
constraint state happens where relation refers to a key attribute of a different
or same relation. However, that key element must exist in the table.
Example:
In the above example, we have 2 relations, Customer and Billing.
Tuple for CustomerID =1 is referenced twice in the relation Billing. So we know
CustomerName=Google has billing amount $300

Operations in Relational Model:-


Four basic update operations performed on relational database model are
Insert, update, delete and select.
Insert is used to insert data into the relation
Delete is used to delete tuples from the table.
Modify allows you to change the values of some attributes in existing tuples.
Select allows you to choose a specific range of data.
Whenever one of these operations are applied, integrity constraints specified
on the relational database schema must never be violated.

Insert Operation:-The insert operation gives values of the attribute for a new
tuple which should be inserted into a relation.
Update Operation:-You can see that in the below-given relation table
CustomerName= 'Apple' is updated from Inactive to Active.

Delete Operation:-To specify deletion, a condition on the attributes of


the relation selects the tuple to be deleted.

Select Operation

You might also like