Dbms Module 1 Notes
Dbms Module 1 Notes
SEMESTER-3
3133- DATABASE MANAGEMENT SYSTEM
MODULE 1 NOTES
Data
Data is a raw and unorganized fact that required to be processed to make it meaningful.
Information
Information is a set of data which is processed in a meaningful way according to the given
requirement.
Database
The database is a collection of inter-related data which is used to retrieve, insert and
delete the data efficiently.
For example: The college Database organizes the data about the admin, staff,
students and faculty etc.
Using the database, we can easily retrieve, insert, and delete the information.
Database Management System
Database system
The data base and the DBMS software are collectively known as database system.
Characteristics of DBMS
It can provide a clear and logical view of the process that manipulates data.
DBMS contains automatic backup and recovery procedures.
It can reduce the complex relationship between data.
It is used to support manipulation and processing of data.
It is used to provide security of data.
DBMS is used in following sectors
Schema definition.
Storage structure and access method definition
Granting of authorization for data access
Routine Maintenance anting of authorization for data access.
DATABASE MODEL
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 systems.
There are many kinds of data models, some of the most common ones include:
It organizes data into a tree like structure with a single root to which all the other
data is linked
Its structure is a tree with nodes representing records and branches representing
fields
Data is organized into tree like structure with one to many relationship between
two different types of data(1:n)
Example: One department can have many courses many professors and of course
many students.
1) A database may also have several schemas at the view level sometimes called
subschemas that describes different views of the database.
Database state:
Refers to content of a database at a moment in time.
DATABASE THREE-SCHEMA ARCHITECTURE
DATABASE LANGUAGE
Database language is used to read, store and update the data in the database.
The following are the database languages:
Data definition language (DDL)
Data Manipulation Language(DML)
Data Control Language (DCL)
Transaction Control Language(TCL)
1) Data Definition Language (DDL)
It is used for specifying the database schema.
The language is used to create database, alter database, rename database or drop
database.
It is a type of language that allows the DBA or user to depict and name those
entities, attributes, and relationships that are required for the application along with
any associated integrity and security constraints.
DDL statements include:
CREATE: create new database, table
ALTER: used to remove all records from a table, including all spaces allocated
for the records are removed.
DROP: Drop the database table.
RENAME: Set a new name for the table.
TRUNCATE: used to remove all records from a table including all spaces
allocated for the records are removed.
2) Data Manipulation Language(DML)
Data manipulation language is used for both reading and updating the database
DML statements are used to manage data within schema objects.
The language used to manipulate the database like inserting data, updating
table, retrieving record from a table.
DML statements include:
SELECT: It retrieves data from a database.
INSERT: It inserts data into a table.
UPDATE: It updates existing data within a table.
DELETE: It deletes all records from a table, the space for the records remain.
3) Data Control Language (DCL)
The data control language is used to control privilege in database.
To perform any operation in the database such as for creating tables, sequences
or views we need privileges.
DCL statements includes:
GRANT: give privilege to access the database.
REVOKE: Take back the privilege to access the database.
4) Transaction Control Language(TCL)
Transaction Control statements are used to run the changes made by DML
statements.
It allows statements to be grouped into logical transactions.
TRANSACTION CONTROL statements includes:
COMMIT: It saves the work done.
SAVEPOINT: It identifies a point in a transaction to which you can later
roll back
ROLLBACK: It restores the database to original since the last COMMIT.
SET TRANSACTION: It changes the transaction options like isolation level
and what rollback segment to use
Database Interfaces
The user and the database are connected through DBMS interfaces.
They give users an easy-to-use interface so they may access and change the data
that is stored in the database.
There are several DBMS interface types, each created to meet certain user
requirements.
Command-Line Interface (CLI)
The earliest and most fundamental form of DBMS interface is the
command-line interface (CLI).
Through the use of a command prompt, users may communicate with
the database by inputting commands.
Users can only access and modify the database using particular
commands and syntax.
Today, programmers and database administrators are the main users
of CLI.
Graphical User Interface (GUI)
The most prevalent kind of DBMS interface used nowadays is the
graphical user interface (GUI).
Users may interact with the database using the user-friendly interface's
graphical menus and icons.
GUIs are user-friendly and need little to no programming experience.
They are mostly utilized by non-programmers who are end users.
Web-Based Interface
Users can access the database using a browser using the web-based
interface.
Users can use online forms, buttons, and other graphical components
to interact with the database using a web browser.
Because they can be accessed from any location with an internet
connection, web-based interfaces are common.
Natural Language Interface
This interface enables users to communicate with the database in their
own language.
The system will convert user inquiries into SQL instructions and carry
them out if they are entered in plain English.
Users who are unfamiliar with SQL commands might benefit from using
natural language interfaces.
Forms-Based Interface
Using the forms-based interface, users may enter data into the
database using a graphical user interface.
Users can complete pre-made forms that provide fields for particular
categories of information, such as name, address, and phone number.
Applications for data entry frequently employ forms-based interfaces.
Menu-Based Interface
Users have access to a number of predefined menus and choices when
using the menu-based interface to interact with the database.
Users can choose the menu choice that reflects the intended action,
such as adding or removing data, from the available options.
The majority of specialized applications and embedded systems
employ menu-based interfaces.
Components of DBMS
1. Hardware
o Here the hardware means the physical part of the DBMS. Here the hardware includes
output devices like a printer, monitor, etc., and storage devices like a hard disk.
o In DBMS, information hardware is the most important visible part.
o The equipment which is used for the visibility of the data is the printer, computer,
scanner, etc. This equipment is used to capture the data and present the output to
the user.
o With the help of hardware, the DBMS can access and update the database.
2. Software
o Software is the main component of the DBMS.
o Software is defined as the collection of programs that are used to instruct the
computer about its work.
o The software consists of a set of procedures, programs, and routines associated with
the computer system's operation and performance. Also, we can say that computer
software is a set of instructions that is used to instruct the computer hardware for the
operation of the computers.
3. Data
o The term data means the collection of any raw fact stored in the database.
o Here the data are any type of raw material from which meaningful information is
generated.
o The database can store any form of data, such as structural data, non-structural data,
and logical data.
o The structured data are highly specific in the database and have a structured format.
4. Procedures
o The procedure is a type of general instruction or guidelines for the use of DBMS. This
instruction includes how to set up the database, how to install the database, how to
log in and log out of the database, how to manage the database, how to take a backup
of the database, and how to generate the report of the database.
o In DBMS, with the help of procedure, we can validate the data, control the access and
reduce the traffic between the server and the clients.
o The DBMS can offer better performance to extensive or complex business logic when
the user follows all the procedures correctly.
o The main purpose of the procedure is to guide the user during the management and
operation of the database.
5. Database Access Language
o Database Access Language is a simple language that allows users to write commands
to perform the desired operations on the data that is stored in the database.
o Database Access Language is a language used to write commands to access, insert,
and delete data stored in a database.
o It includes DDL,DML,DCL etc.
In this database system, application programs and user interface all are
executed on a single system and dummy terminals are connected to it.
The processing power of single system is utilized and dummy terminals are
used only to display the information.
In this approach application programs and database system are placed in the
client side.
Client server architecture
Domain: The domain refers to the possible values each attribute can contain. It can be
specified using standard data types such as integers, floating numbers, etc.
Attribute: A column or attribute is a vertical entity in the table which contains all
information associated with a specific field in a table.
Tuples: A row of a table is also called a record or tuple. It contains the specific
information of each entry in the table. It is a horizontal entity in the table.
The total number of attributes that comprise a relation is known as the degree of the table.
Cardinality:
The total number of tuples at any one time in a relation is known as the table's cardinality.
Keys
Keys are one of the basic requirements of a relational database model. It is widely used
to identify the tuples (rows) uniquely in the table
Primary key:
There can be more than one candidate key in relation out of which one can be
chosen as the primary key.
It is a unique key.
It can identify only one tuple (a record) at a time.
Super key
The set of attributes that can uniquely identify a tuple is known as Super Key.
Candidate key:
The minimal set of attributes that can uniquely identify a tuple is known as a
candidate key.
Properties of a Relation:
This type of data model is used to represent only the logical part of the
database and does not represent the physical structure of the database.
The representational data model allows us to focus primarily, on the design
part of the database.
A popular representational model is a Relational model. The relational Model
consists of Relational Algebra and Relational Calculus.
Relational Constraints
Domain Constraints