You are on page 1of 7

INTRODUCTION TO DBMS & RDBMS

A DBMS (Database Management System) is a software program used to manage a database. These
programs enable users to access and modify database.It basically control the storage management and
fetching of data from database.

A DBMS includes four main components, which are:


-Modeling Language,
-Data Structures,
-DB Query Language and Report Writer,
-Transaction Mechanism.

RDBMS
RDBMS is relational database management system. Basically, we can say that RDBMS is an extension
of DBMS systems.

Difference between DBMS and RDBMS

1. RDBMS (Relational database management system) applications store data in a tabular form while
DBMS applications store data as files.

2. Normalization is added to RDBMS whereas not present in DBMS system.

3. RDBMS maintained relationship between tables ( Primary Key or Foreign Key contraints) but in
DBMS is not maintained.

4. RDBMS Support ACID property of Transaction (Atomocity, Consistency, Isolation and Durability)
but DBMS not.

5. RDBMS supports distributed database but DBMS not.

6. Example of RDBMS are mysql, postgre, sql server, oracle etc and DBMS are file systems, xml,Dbase,
Microsoft Access, LibreOffice Base, FoxPro etc,

TYPES OF LANGUAGE:

Database: Database is a collection of inter-related data which helps in efficient retrieval, insertion
and deletion of data from database and organizes the data in the form of tables, views, schemas,
reports etc. For Example, university database organizes the data about students, faculty, and admin
staff etc. which helps in efficient retrieval, insertion and deletion of data from it.

DDL is short name of Data Definition Language, which deals with database schemas and descriptions,
of how the data should reside in the database.

 CREATE: to create a database and its objects like (table, index, views, store procedure, function,
and triggers)
 ALTER: alters the structure of the existing database
 DROP: delete objects from the database
 TRUNCATE: remove all records from a table, including all spaces allocated for the records are
removed
 COMMENT: add comments to the data dictionary
 RENAME: rename an object

DML is short name of Data Manipulation Language which deals with data manipulation and
includes most common SQL statements such SELECT, INSERT, UPDATE, DELETE, etc., and it is
used to store, modify, retrieve, delete and update data in a database.
 SELECT: retrieve data from a database
 INSERT: insert data into a table
 UPDATE: updates existing data within a table
 DELETE: Delete all records from a database table
 MERGE: UPSERT operation (insert or update)
 CALL: call a PL/SQL or Java subprogram
 EXPLAIN PLAN: interpretation of the data access path
 LOCK TABLE: concurrency Control

Database Management System: The software which is used to manage database is called Database
Management System (DBMS). For Example, MySQL, Oracle etc. are popular commercial DBMS used
in different applications. DBMS allows users the following tasks:

DCL – DATA CONTROL LANGUAGE


The SQL sentences, which are used to control the behavior of these objects, are called DCL’s or Data
Control Language. It is language used to control data and access to the database. Following are some
DCL commands are
• Commit
• Rollback
• Save point
• Set transaction

A Data Control Language (DCL) is a computer language and a subset of SQL, used to control access to
data in a database.
Examples of DCL commands include:
• GRANT to allow specified users to perform specified tasks.
• REVOKE to cancel previously granted or denied permissions.

The following privileges can be GRANTED TO or REVOKED FROM a user or role:


• CONNECT
• SELECT
• INSERT
• UPDATE
• DELETE
• EXECUTE
• USAGE

Data Definition: It helps in creation, modification and removal of definitions that define the
organization of data in database.
Data Updation: It helps in insertion, modification and deletion of the actual data in the database.
Data Retrieval: It helps in retrieval of data from the database which can be used by applications for
various purposes.
User Administration: It helps in registering and monitoring users, enforcing data security, monitoring
performance, maintaining data integrity, dealing with concurrency control and recovering information
corrupted by unexpected failure.
Paradigm Shift from File System to DBMS
File System manages data using files in hard disk. Users are allowed to create, delete, and update
the files according to their requirement.
 Let us consider the example of file based University Management System.

 Data of students is available to their respective Departments, Academics Section, Result


Section, Accounts Section, Hostel Office etc.

 Some of the data is common for all sections like Roll No, Name, Father Name, Address and
Phone number of students but some data is available to a particular section only like Hostel
allotment number which is a part of hostel office.

 Let us discuss the issues with this system:

 Redundancy of data: Data is said to be redundant if same data is copied at many places. If a
student wants to change Phone number, he has to get it updated at various sections. Similarly,
old records must be deleted from all sections representing that student.

 Inconsistency of Data: Data is said to be inconsistent if multiple copies of same data does not
match with each other. If Phone number is different in Accounts Section and Academics
Section, it will be inconsistent. Inconsistency may be because of typing errors or not updating all
copies of same data.

 Difficult Data Access: A user should know the exact location of file to access data, so the
process is very cumbersome and tedious. If user wants to search student hostel allotment number of
a student from 10000 unsorted students’ records, how difficult it can be.

 Unauthorized Access: File System may lead to unauthorized access to data. If a student gets
access to file having his marks, he can change it in unauthorized way.
 No Concurrent Access: The access of same data by multiple users at same time is known as
concurrency. File system does not allow concurrency as data can be accessed by only one user at a
time.
 No Backup and Recovery: File system does not incorporate any backup and recovery of data if a
file is lost or corrupted.
What is Oracle

Oracle database is a relational database management system. It is known as Oracle database,


OracleDB or simply Oracle. It is produced and marketed by Oracle Corporation.

Oracle database is the first database designed for enterprise grid computing. The enterprise grid
computing provides the most flexible and cost effective way to manage information and applications.

The Oracle Corporation

Oracle Corporation is the largest software company in the field of database business. Its relational
database was the first to support SQL which has since become the industry standard.

Oracle database is one of the most trusted and widely used relational database engines. The biggest rival
of Oracle database is Microsoft's SQL Server.

History of Oracle

Oracle was originally developed by Lawrence Ellison (Larry Ellision) and his two friends and
former co-worker in 1977.

SQL

SQL is a language to operate databases; it includes database creation, deletion, fetching rows,
modifying rows, etc.

What is SQL?

SQL is Structured Query Language, which is a computer language for storing, manipulating and
retrieving data stored in a relational database.
SQL is the standard language for Relational Database System. All the Relational Database Management
Systems (RDMS) like MySQL, MS Access, Oracle, Sybase, Informix, Postgres and SQL Server use
SQL as their standard database language.
Also, they are using different dialects, such as −

 MS SQL Server using T-SQL,


 Oracle using PL/SQL,
 MS Access version of SQL is called JET SQL (native format) etc.

Why SQL?

SQL is widely popular because it offers the following advantages −


 Allows users to access data in the relational database management systems.
 Allows users to describe the data.
 Allows users to define the data in a database and manipulate that data.
 Allows to embed within other languages using SQL modules, libraries & pre-compilers.
 Allows users to create and drop databases and tables.
 Allows users to create view, stored procedure, functions in a database.
 Allows users to set permissions on tables, procedures and views.

SQL Data Types

Data types are used to represent the nature of the data that can be stored in the database table. For
example, in a particular column of a table, if we want to store a string type of data then we will have to
declare a string data type of this column.

Data types mainly classified into three categories for every database.

o String Data types


o Numeric Data types
o Date and time Data types

SQL Server String Data Type

char(n) It is a fixed width character string data type. Its size can be up to 8000 characters.

varchar(n) It is a variable width character string data type. Its size can be up to 8000 characters.

varchar(max) It is a variable width character string data types. Its size can be up to 1,073,741,824 characters.

text It is a variable width character string data type. Its size can be up to 2GB of text data.

nchar It is a fixed width Unicode string data type. Its size can be up to 4000 characters.

nvarchar It is a variable width Unicode string data type. Its size can be up to 4000 characters.

ntext It is a variable width Unicode string data type. Its size can be up to 2GB of text data.

binary(n) It is a fixed width Binary string data type. Its size can be up to 8000 bytes.

varbinary It is a variable width Binary string data type. Its size can be up to 8000 bytes.

image It is also a variable width Binary string data type. Its size can be up to 2GB.
Oracle Data Types

Oracle String data types

CHAR(size) It is used to store character data within the predefined length. It can be stored up to 2000 bytes.

NCHAR(size) It is used to store national character data within the predefined length. It can be stored up to
2000 bytes.

VARCHAR2(size) It is used to store variable string data within the predefined length. It can be stored up to 4000
byte.

VARCHAR(SIZE) It is the same as VARCHAR2(size). You can also use VARCHAR(size), but it is suggested to
use VARCHAR2(size)

NVARCHAR2(size) It is used to store Unicode string data within the predefined length. We have to must specify
the size of NVARCHAR2 data type. It can be stored up to 4000 bytes.

Oracle Numeric Data Types

NUMBER(p, s) It contains precision p and scale s. The precision p can range from 1 to 38, and the scale s can
range from -84 to 127.

FLOAT(p) It is a subtype of the NUMBER data type. The precision p can range from 1 to 126.

BINARY_FLOAT It is used for binary precision( 32-bit). It requires 5 bytes, including length byte.

BINARY_DOUBLE It is used for double binary precision (64-bit). It requires 9 bytes, including length byte.

Oracle Date and Time Data Types

DATE It is used to store a valid date-time format with a fixed length. Its range varies from
January 1, 4712 BC to December 31, 9999 AD.

TIMESTAMP It is used to store the valid date in YYYY-MM-DD with time hh:mm:ss format.

You might also like