RDBMS Unit 1

You might also like

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

Unit 1

RDBMS
RDBMS stands for Relational Database Management System. RDBMS is the basis for
SQL, and for all modern database systems like MS SQL Server, IBM DB2, Oracle,
MySQL, and Microsoft Access.
A Relational database management system (RDBMS) is a database management
system (DBMS) that is based on the relational model as introduced by E. F. Codd.

What is a table?
The data in an RDBMS is stored in database objects which are called as tables. This
table is basically a collection of related data entries and it consists of numerous
columns and rows.
Remember, a table is the most common and simplest form of data storage in a
relational database. The following program is an example of a CUSTOMERS table −
+----+----------+-----+-----------+----------+
| ID | NAME | AGE | ADDRESS | SALARY |
+----+----------+-----+-----------+----------+
| 1 | Ramesh | 32 | Ahmedabad | 2000.00 |
| 2 | Khilan | 25 | Delhi | 1500.00 |
| 3 | kaushik | 23 | Kota | 2000.00 |
| 4 | Chaitali | 25 | Mumbai | 6500.00 |
| 5 | Hardik | 27 | Bhopal | 8500.00 |
| 6 | Komal | 22 | MP | 4500.00 |
| 7 | Muffy | 24 | Indore | 10000.00 |

What is a field?
Every table is broken up into smaller entities called fields. The fields in the
CUSTOMERS table consist of ID, NAME, AGE, ADDRESS and SALARY.
A field is a column in a table that is designed to maintain specific information about
every record in the table.

What is a Record or a Row?


A record is also called as a row of data is each individual entry that exists in a table.
For example, there are 7 records in the above CUSTOMERS table. Following is a
single row of data or record in the CUSTOMERS table −
+----+----------+-----+-----------+----------+
| 1 | Ramesh | 32 | Ahmedabad | 2000.00 |
+----+----------+-----+-----------+----------+

A record is a horizontal entity in a table.

What is a column?
A column is a vertical entity in a table that contains all information associated with a
specific field in a table.
For example, a column in the CUSTOMERS table is ADDRESS, which represents
location description and would be as shown below −
+-----------+
| ADDRESS |
+-----------+
| Ahmedabad |
| Delhi |
| Kota |
| Mumbai |
| Bhopal |
| MP |
| Indore |
+----+------+

Features of RDBMS Systems:

 All data stored in the tables are provided by an RDBMS

 Ensures that all data stored are in the form of rows and columns

 Facilitates primary key, which helps in unique identification of the rows

 Index creation for retrieving data at a higher speed

 Facilitates a common column to be shared amid two or more tables

 Multi-user accessibility is facilitated to be controlled by individual users


 A virtual table creation is enabled to store sensitive data and simplify queries

Advantage of File-oriented system:


1. Backup:
 It is possible to take faster and automatic back-up of database stored in files of computer-based
systems.
 computer systems provide functionalities to serve this purpose.it is also possible to develop specific
application program for this purpose.

2. Compactness:
 It is possible to store data compactly.

3. Data Retrieval:
 Computer-based systems provide enhanced data retrieval techniques to retrieve data stored in files
in easy and efficient way.

4. Editing:
 It is easy to edit any information stored in computers in form of files.
 Specific application programs or editing software can be used for this purpose.

5. Remote Access:
 In computer-based systems,it is possible to access data remotely.
 so,to access data it is not necessary for a user to remain present at location where these data are
kept.

6. Sharing:
 Data stored in files of computer-based systems ca be shared among multiple users at a same time.

Disadvantage of File-oriented system:


1. Data Redundancy:
 It is possible that the same information may be duplicated in different files.this leads to data
redundancy results in memory wastage.
2. Data Inconsistency:
 Because of data redundancy,it is possible that data may not be in consistent state.

3. Difficulty in Accessing Data:


 Accessing data is not convenient and efficient in file processing system.

4. Limited Data Sharing:


 Data are scattered in various files.also different files may have different formats and these files may
be stored in different folders may be of different departments.
 So, due to this data isolation, it is difficult to share data among different applications.

5. Integrity Problems:
 Data integrity means that the data contained in the database in both correct and consistent.for this
purpose the data stored in database must satisfy correct and constraints.

6. Atomicity Problems:
 Any operation on database must be atomic.
 this means, it must happen in its entirely or not at all.

7. Concurrent Access Anomalies:


 Multiple users are allowed to access data simultaneously.this is for the sake of better performance
and faster response.

8. Security Problems:
 Database should be accessible to users in limited way.
 Each user should be allowed to access data concerning his requirements only.

DBMS
Database Management System (DBMS) is a software for storing and
retrieving users’ data while considering appropriate security measures. It
consists of a group of programs which manipulate the database. The DBMS
accepts the request for data from an application and instructs the operating
system to provide the specific data. In large systems, a DBMS helps users
and other third-party software to store and retrieve data.
DBMS allows users to create their own databases as per their requirement.
The term “DBMS” includes the user of the database and other application
programs. It provides an interface between the data and the software
application.

Advantages of DBMS
o Controls database redundancy: It can control data redundancy because it stores
all the data in one single database file and that recorded data is placed in the
database.
o Data sharing: In DBMS, the authorized users of an organization can share the
data among multiple users.
o Easily Maintenance: It can be easily maintainable due to the centralized nature
of the database system.
o Reduce time: It reduces development time and maintenance need.
o Backup: It provides backup and recovery subsystems which create automatic
backup of data from hardware and software failures and restores the data if
required.
o multiple user interface: It provides different types of user interfaces like
graphical user interfaces, application program interfaces

Disadvantages of DBMS
o Cost of Hardware and Software: It requires a high speed of data processor and
large memory size to run DBMS software.
o Size: It occupies a large space of disks and large memory to run them efficiently.
o Complexity: Database system creates additional complexity and requirements.
o Higher impact of failure: Failure is highly impacted the database because in
most of the organization, all the data stored in a single database and if the
database is damaged due to electric failure or database corruption then the data
may be lost forever.

Client Server Architecture


Client-server architecture is also called of the “Client/Server
Network” or “Network computing Model“, because in this
architecture all services and requests are spread over the network. Its
functionality like as distributed computing system because in which
all components are performing their tasks independently from each
other.
Client-server architecture is a shared computer network architecture
where several clients (remote system) send many requests and finally
to obtained services from the centralized server machine (host
system). Client machine delivers user-friendly interface that helps to
users to fire request services of server computer and finally to show
your output on client system.

Types of Client-Server Architecture


1-Tier Architecture
In the 1-tier architecture, all client/server configuration setting, user
interface environment, data logic, and marketing logic system are
existed on the same system. These types of services are reliable but it
is very difficult tasks to handle because they contain all data in
different variance, which are allotted the replication of entire work.
This architecture also contain the different layers.

For example – Presentation, Business, Data Access layer with using


of single software package. All data is saved on the local machine.
Some applications, which manage all three tiers like as MP3 player,
MS Office; but these types of applications are presented under 1-tier
architecture applications. 
2-Tier Architecture
2-tier architecture provides the best client/server environment that
helps to store user interface on the client system and all database is
saved on the server machine. Business logic and database logic are
existed on the client otherwise server, but they are required to be
maintained. When data logic and business are gathered on the client
terminal then it is known as “fat client thin server architecture”. But if
Business Logic and Data Logic are controlled at the server machine
then it is known as “thin client fat server architecture”.

In this architecture, client and server machines are connected directly


incorporation because if client is firing any input for server terminal
then in between should not any intermediate. So, it delivers the output
with fastest rate and to ignore misunderstanding between the other
clients. For example – online ticket reservations program, in which 2-
tier architecture is used.

3-Tier Architecture
In this 3-tier architecture, middleware is needed because if client
machine sends the request to server machine then firstly this request
is received by middle layer, and finally this request is obtained to
server. So, firstly response of server is received by middle layer then it
is obtained to client machine. All data logic and business logic are
stored on the middleware. Due to use of middleware,  to improve its
flexibility and deliver excellent performance.

3-tier architecture is divided into 3 layers such as presentation layer


(Client Tier), Application layer (Business Tier) and Database layer
(Data Tier). Client machine handles the presentation layer, Application
layer controls the Application layer, and finally Server machine takes
care of Database layer.

Data
In simple words, data can be facts related to any object in consideration. For
example, your name, age, height, weight, etc. are some data related to you. A
picture, image, file, pdf, etc. can also be considered data.

Database
A database is a systematic collection of data. They support electronic storage
and manipulation of data. Databases make data management easy.

Let us discuss a database example: An online telephone directory uses a


database to store data of people, phone numbers, and other contact details.
Your electricity service provider uses a database to manage billing, client-
related issues, handle fault data, etc.

Let us also consider Facebook. It needs to store, manipulate, and present


data related to members, their friends, member activities, messages,
advertisements, and a lot more. We can provide a countless number of
examples for the usage of databases.

Operation of DBMS:-

Select Statement
To fetch data from the database, the SELECT statement is used

Insert
The INSERT command is used to insert data in the database.

Update
The database needs to be updated for new records. In that case, use the Update
command.

Delete
Delete records from the database by selecting the rows you need to delete.

DBMS Database Models


A Database model defines the logical design and structure of a
database and defines how data will be stored, accessed and updated
in a database management system.

 Hierarchical Model

 Network Model

 Relation Model
Hierarchical Model

This database model organises data into a tree-like-structure, with a


single root, to which all the other data is linked. The heirarchy starts
from the Root data, and expands like a tree, adding child nodes to the
parent nodes.

In this model, a child node will only have a single parent node.

This model efficiently describes many real-world relationships like


index of a book, recipes etc.

In hierarchical model, data is organised into tree-like structure with


one one-to-many relationship between two different types of data, for
example, one department can have many courses, many professors
and of-course many students.

Network Model

This is an extension of the Hierarchical model. In this model data is


organised more like a graph, and are allowed to have more than one
parent node.
In this database model data is more related as more relationships are
established in this database model. Also, as the data is more related,
hence accessing the data is also easier and fast. This database model
was used to map many-to-many data relationships.

This was the most widely used database model, before Relational
Model was introduced.

Relational Model

In this model, data is organised in two-dimensional tables and the


relationship is maintained by storing a common field.

This model was introduced by E.F Codd in 1970, and since then it has
been the most widely used database model, infact, we can say the only
database model used around the world.

The basic structure of data in the relational model is tables. All the
information related to a particular type is stored in rows of that table.

Hence, tables are also known as relations in relational model.


Database Components
The major components of the Database are:

 Hardware

This consists of a set of physical electronic devices such as I/O devices, storage
devices and many more. It also provides an interface between computers and real-
world systems.

 Software

This is the set of programs that are used to control and manage the overall Database. It
also includes the DBMS software itself. The Operating System, the network software
being used to share the data among the users, the application programs used to access
data in the DBMS.
 Data

Database Management System collects, stores, processes, and accesses data. The
Database holds both the actual or operational data and the metadata.

 Procedure

These are the rules and instructions on how to use the Database in order to design and
run the DBMS, to guide the users that operate and manage it.

 Database Access Language

It is used to access the data to and from the database. In order to enter new data,
updating, or retrieving requires data from databases. You can write a set of appropriate
commands in the database access language, submit these to the DBMS, which then
processes the data and generates it, displays a set of results into a user-readable form.

Logical Data Model


The Logical Data Model is used to define the structure of data elements and
to set relationships between them. The logical data model adds further
information to the conceptual data model elements. The advantage of using a
Logical data model is to provide a foundation to form the base for the Physical
model. However, the modeling structure remains generic.

Logical Data
Model
At this Data Modeling level, no primary or secondary key is defined. At this
Data modeling level, you need to verify and adjust the connector details that
were set earlier for relationships.
Characteristics of a Logical data model

 Describes data needs for a single project but could integrate with other
logical data models based on the scope of the project.
 Designed and developed independently from the DBMS.
 Data attributes will have datatypes with exact precisions and length.
 Normalization processes to the model is applied typically till 3NF.

Physical Data Model


A Physical Data Model describes a database-specific implementation of the
data model. It offers database abstraction and helps generate the schema.
This is because of the richness of meta-data offered by a Physical Data
Model. The physical data model also helps in visualizing database structure
by replicating database column keys, constraints, indexes, triggers, and other
RDBMS features.

Physical Data
Model
Characteristics of a physical data model:
 The physical data model describes data need for a single project or
application though it maybe integrated with other physical data models
based on project scope.
 Data Model contains relationships between tables that which addresses
cardinality and nullability of the relationships.
 Developed for a specific version of a DBMS, location, data storage or
technology to be used in the project.
 Columns should have exact datatypes, lengths assigned and default
values.
 Primary and Foreign keys, views, indexes, access profiles, and
authorizations, etc. are defined.

You might also like