0% found this document useful (0 votes)
2 views

Database Notes

A Database Management System (DBMS) is software that manages and organizes data, allowing users to create, modify, and query databases while ensuring data integrity and security. DBMS can be classified into Relational (RDBMS) and Non-Relational (NoSQL) types, with various database languages such as DDL, DML, DCL, and TCL for different operations. Applications of DBMS span across various sectors including enterprise information, banking, and education, offering advantages like data organization and security, but also presenting challenges such as complexity and cost.

Uploaded by

Yaseen
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Database Notes

A Database Management System (DBMS) is software that manages and organizes data, allowing users to create, modify, and query databases while ensuring data integrity and security. DBMS can be classified into Relational (RDBMS) and Non-Relational (NoSQL) types, with various database languages such as DDL, DML, DCL, and TCL for different operations. Applications of DBMS span across various sectors including enterprise information, banking, and education, offering advantages like data organization and security, but also presenting challenges such as complexity and cost.

Uploaded by

Yaseen
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

A Database Management System (DBMS) is a software system that is designed

to manage and organize data in a structured manner. It allows users to create,


modify, and query a database, as well as manage the security and access
controls for that database.
DBMS provides an environment to store and retrieve the data in coinvent and
efficient manner.
Key Features of DBMS
 Data modeling: A DBMS provides tools for creating and modifying data
models, which define the structure and relationships of the data in a
database.
 Data storage and retrieval: A DBMS is responsible for storing and
retrieving data from the database, and can provide various methods for
searching and querying the data.
 Concurrency control: A DBMS provides mechanisms for controlling
concurrent access to the database, to ensure that multiple users can access
the data without conflicting with each other.
 Data integrity and security: A DBMS provides tools for enforcing data
integrity and security constraints, such as constraints on the values of data
and access controls that restrict who can access the data.
 Backup and recovery: A DBMS provides mechanisms for backing up and
recovering the data in the event of a system failure.
 DBMS can be classified into two types: Relational Database Management
System (RDBMS) and Non-Relational Database Management System
(NoSQL or Non-SQL)
 RDBMS: Data is organized in the form of tables and each table has a set of
rows and columns. The data are related to each other through primary and
foreign keys.
 NoSQL: Data is organized in the form of key-value pairs, documents,
graphs, or column-based. These are designed to handle large-scale, high-
performance scenarios.
A database is a collection of interrelated data which helps in the efficient
retrieval, insertion, and deletion of data from the database and organizes the
data in the form of tables, views, schemas, reports, etc. For Example, a
university database organizes the data about students, faculty, admin staff, etc.
which helps in the efficient retrieval, insertion, and deletion of data from it.
Database Languages
 Data Definition Language
 Data Manipulation Language
 Data Control Language
 Transactional Control Language
Data Definition Language
DDL is the short name for 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
Data Manipulation Language
DML is the short name for 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
Data Control Language
DCL is short for Data Control Language which acts as an access specifier to
the database.(basically to grant and revoke permissions to users in the
database
 GRANT: grant permissions to the user for running DML(SELECT, INSERT,
DELETE,…) commands on the table
 REVOKE: revoke permissions to the user for running DML(SELECT,
INSERT, DELETE,…) command on the specified table
Transactional Control Language
TCL is short for Transactional Control Language which acts as an manager for
all types of transactional data and all transactions. Some of the command of
TCL are
 Roll Back: Used to cancel or Undo changes made in the database
 Commit: It is used to apply or save changes in the database
 Save Point: It is used to save the data on the temporary basis in the
database
Data retrieval language:
DRL is short for Data Retrieval Language which is used for retrieval of data. It
can also be said as DML.
 SELECT: Used for extracting the required data.
Database Management System
The software which is used to manage databases 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:
 Data Definition: It helps in the creation, modification, and removal of
definitions that define the organization of data in the database.
 Data Updation: It helps in the insertion, modification, and deletion of the
actual data in the database.
 Data Retrieval: It helps in the 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.
Applications of DBMS:
 Enterprise Information: Sales, accounting, human resources,
Manufacturing, online retailers.
 Banking and Finance Sector: Banks maintaining the customer details,
accounts, loans, banking transactions, credit card transactions. Finance:
Storing the information about sales and holdings, purchasing of financial
stocks and bonds.
 University: Maintaining the information about student course enrolled
information, student grades, staff roles.
 Airlines: Reservations and schedules.
 Telecommunications: Prepaid, postpaid bills maintance.
Advantages of DBMS
 Data organization: A DBMS allows for the organization and storage of data
in a structured manner, making it easy to retrieve and query the data as
needed.
 Data integrity: A DBMS provides mechanisms for enforcing data integrity
constraints, such as constraints on the values of data and access controls
that restrict who can access the data.
 Concurrent access: A DBMS provides mechanisms for controlling
concurrent access to the database, to ensure that multiple users can access
the data without conflicting with each other.
 Data security: A DBMS provides tools for managing the security of the data,
such as controlling access to the data and encrypting sensitive data.
 Backup and recovery: A DBMS provides mechanisms for backing up and
recovering the data in the event of a system failure.
 Data sharing: A DBMS allows multiple users to access and share the same
data, which can be useful in a collaborative work environment.
Disadvantages of DBMS
 Complexity: DBMS can be complex to set up and maintain, requiring
specialized knowledge and skills.
 Performance overhead: The use of a DBMS can add overhead to the
performance of an application, especially in cases where high levels of
concurrency are required.
 Scalability: The use of a DBMS can limit the scalability of an application,
since it requires the use of locking and other synchronization mechanisms to
ensure data consistency.
 Cost: The cost of purchasing, maintaining and upgrading a DBMS can be
high, especially for large or complex systems.
 Limited Use Cases: Not all use cases are suitable for a DBMS, some
solutions don’t need high reliability, consistency or security and may be
better served by other types of data storage.
These are the main reasons which made a shift from file system to DBMS. Also,
see
A Database Management System (DBMS) is a software system that allows
users to create, maintain, and manage databases. It is a collection of programs
that enables users to access and manipulate data in a database. A DBMS is
used to store, retrieve, and manipulate data in a way that provides security,
privacy, and reliability.

A Data Model in Database Management System (DBMS) is the concept of


tools that are developed to summarize the description of the database. Data
Models provide us with a transparent picture of data which helps us in creating
an actual database. It shows us from the design of the data to its proper
implementation of data.

Types of Relational Models


1. Conceptual Data Model
2. Representational Data Model
3. Physical Data Model
It is basically classified into 3 types:-
1. Conceptual Data Model

The conceptual data model describes the database at a very high level and is
useful to understand the needs or requirements of the database. It is this
model, that is used in the requirement-gathering process i.e. before the
Database Designers start making a particular database. One such popular
model is the entity/relationship model (ER model) . The E/R model specializes in
entities, relationships, and even attributes that are used by database designers.
In terms of this concept, a discussion can be made even with non-computer
science(non-technical) users and stakeholders, and their requirements can be
understood.
Entity-Relationship Model( ER Model): It is a high-level data model which is
used to define the data and the relationships between them. It is basically a
conceptual design of any database which is easy to design the view of data.
Components of ER Model:
1. Entity: An entity is referred to as a real-world object. It can be a name,
place, object, class, etc. These are represented by a rectangle in an ER
Diagram.
2. Attributes: An attribute can be defined as the description of the entity.
These are represented by Eclipse in an ER Diagram. It can be Age, Roll
Number, or Marks for a Student.
3. Relationship: Relationships are used to define relations among different
entities. Diamonds and Rhombus are used to show Relationships.

Characteristics of a conceptual data model

 Offers Organization-wide coverage of the business concepts.


 This type of Data Models are designed and developed for a business
audience.
 The conceptual model is developed independently of hardware
specifications like data storage capacity, location or software specifications
like DBMS vendor and technology. The focus is to represent data as a user
will see it in the “real world.”
Conceptual data models known as Domain models create a common
vocabulary for all stakeholders by establishing basic concepts and scope

3. Relational Data Model

The physical Data Model is used to practically implement Relational Data


Model. Ultimately, all data in a database is stored physically on a secondary
storage device such as discs and tapes. This is stored in the form of files,
records, and certain other data structures. It has all the information on the
format in which the files are present and the structure of the databases, the
presence of external data structures, and their relation to each other. Here, we
basically save tables in memory so they can be accessed efficiently. In order to
come up with a good physical model, we have to work on the relational model in
a better way. Structured Query Language (SQL) is used to practically
implement Relational Algebra.
This Data Model describes HOW the system will be implemented using a
specific DBMS system. This model is typically created by DBA and developers.
The purpose is actual implementation of the database.

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
Some Data Models
1. Hierarchical Model

The hierarchical Model is one of the oldest models in the data model which was
developed by IBM, in the 1950s. In a hierarchical model, data are viewed as a
collection of tables, or we can say segments that form a hierarchical relation. In
this, the data is organized into a tree-like structure where each record consists
of one parent record and many children. Even if the segments are connected as
a chain-like structure by logical associations, then the instant structure can be a
fan structure with multiple branches. We call the illogical associations as
directional associations.

2. Network Model

The Network Model was formalized by the Database Task group in the 1960s.
This model is the generalization of the hierarchical model. This model can
consist of multiple parent segments and these segments are grouped as levels
but there exists a logical association between the segments belonging to any
level. Mostly, there exists a many-to-many logical association between any of
the two segments.
Structured Query Language is a standard Database language that is used to
create, maintain, and retrieve the relational database. In this article, we will
discuss this in detail about SQL. Following are some interesting facts about
SQL. Let’s focus on that.
SQL is case insensitive. But it is a recommended practice to use keywords (like
SELECT, UPDATE, CREATE, etc.) in capital letters and use user-defined
things (like table name, column name, etc.) in small letters.
We can write comments in SQL using “–” (double hyphen) at the beginning of
any line. SQL is the programming language for relational databases (explained
below) like MySQL, Oracle, Sybase, SQL Server, Postgre, etc. Other non-
relational databases (also called NoSQL) databases like MongoDB,
DynamoDB, etc. do not use SQL.
Although there is an ISO standard for SQL, most of the implementations slightly
vary in syntax. So we may encounter queries that work in SQL Server but do
not work in MySQL.
What is Relational Database?
A relational database means the data is stored as well as retrieved in the form
of relations (tables). Table 1 shows the relational database with only one
relation called STUDENT which
stores ROLL_NO, NAME, ADDRESS, PHONE, and AGE of students.
STUDENT Table
ROLL_NO NAME ADDRESS PHONE AGE

1 RAM DELHI 9455123451 18

2 RAMESH GURGAON 9652431543 18

3 SUJIT ROHTAK 9156253131 20

4 SURESH DELHI 9156768971 18

Important Terminologies
These are some important terminologies that are used in terms of relation.
 Attribute:Attributes are the properties that define a relation.
e.g.; ROLL_NO, NAME etc.
 Tuple:Each row in the relation is known as tuple. The above relation
contains 4 tuples, one of which is shown as:
1 RAM DELHI 9455123451 18
 Degree:The number of attributes in the relation is known as degree of the
relation. The STUDENT relation defined above has degree 5.
 Cardinality:The number of tuples in a relation is known as cardinality.
The STUDENTrelation defined above has cardinality 4.
How Queries can be Categorized in Relational
Database?
The queries to deal with relational database can be categorized as:
 Data Definition Language:It is used to define the structure of the database.
e.g; CREATE TABLE, ADD COLUMN, DROP COLUMN and so on.
 Data Manipulation Language:It is used to manipulate data in the relations.
e.g.; INSERT, DELETE, UPDATE and so on.

You might also like