0% found this document useful (0 votes)
192 views18 pages

Dbms-Unit1 Notes For Bca

The document discusses database management systems (DBMS). It defines a database as a collection of interrelated data and DBMS as software that allows users to create, access, and manage data within a database. It provides examples of common DBMS like MySQL and Oracle. It then lists several applications that utilize DBMS, such as banking systems, online shopping, and social media sites. Key characteristics of DBMS are also summarized, including storing data in tables, reducing data redundancy, supporting multiple users, and providing security. Finally, it outlines some drawbacks of earlier file processing systems compared to DBMS, such as potential duplicate or inconsistent data.

Uploaded by

Yugendran S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
192 views18 pages

Dbms-Unit1 Notes For Bca

The document discusses database management systems (DBMS). It defines a database as a collection of interrelated data and DBMS as software that allows users to create, access, and manage data within a database. It provides examples of common DBMS like MySQL and Oracle. It then lists several applications that utilize DBMS, such as banking systems, online shopping, and social media sites. Key characteristics of DBMS are also summarized, including storing data in tables, reducing data redundancy, supporting multiple users, and providing security. Finally, it outlines some drawbacks of earlier file processing systems compared to DBMS, such as potential duplicate or inconsistent data.

Uploaded by

Yugendran S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

DBMS

SYLLABUS

UNIT – 1
WHAT IS DATABASE MANAGEMENT SYSTEM

 DATA BASE :

 The database is a collections of inter -related data which is used to retrieve ,insert and
delete the data efficiently.
 It is also used to organize the data in the form of a table, schema, views and reports ,
etc;

EXAMPLES :

 The college database organize the data about the admin, staff, students and
faculties etc.

 DBMS :

 Database Management Systems (DBMS) are software systems used to store, retrieve,
and run queries on data. A DBMS serves as an interface between an end-user and a
database, allowing users to create, read, update, and delete data in the database.
 DBMS manage the data, the database engine, and the database schema, allowing for
data to be manipulated or extracted by users and other programs. This helps provide
data security, data integrity, concurrency, and also maintain the data consistency in
CASE OF MULTIPLE USERS.

EXAMPLES :

 MYSQL , ORACLE , FOXPRO , POSTGRESQL ARE A VERY POPULAR COMMERCIAL


DATABASE WHICH IS USED IN DIFFERENT APPLICATIONS.

APPLICATIONS OF DBMS :

There are different fields where a database management system is utilized. Following are a few
applications which utilize the information base administration framework –

1. Railway Reservation System –


 In the rail route reservation framework, the information base is needed to store the
record or information of ticket appointments, status about train’s appearance, and
flight. Additionally, if trains get late, individuals become acquainted with it through
the information base update.

2. Library Management System –


 There are loads of books in the library so; it is difficult to store the record of the
relative multitude of books in a register or duplicate. Along these lines, the data set
administration framework (DBMS) is utilized to keep up all the data identified with the
name of the book, issue date, accessibility of the book, and its writer.

3. Banking –
 Database the executive’s framework is utilized to store the exchange data of the client
in the information base.

4. Education Sector –
 Presently, assessments are led online by numerous schools and colleges. They deal
with all assessment information through the data set administration framework
(DBMS). In spite of that understudy’s enlistments subtleties, grades, courses, expense,
participation, results, and so forth all the data is put away in the information base.

5. Credit card exchanges –


 The database Management framework is utilized for buying on charge cards and age of
month to month proclamations.

6. Social Media Sites –


 We all utilization of online media sites to associate with companions and to impart our
perspectives to the world. Every day, many people group pursue these online media
accounts like Pinterest, Facebook, Twitter, and Google in addition to. By the utilization
of the data set administration framework, all the data of clients are put away in the
information base and, we become ready to interface with others.

7. Broadcast communications –
 Without DBMS any media transmission organization can’t think. The Database the
executive’s framework is fundamental for these organizations to store the call
subtleties and month to month postpaid bills in the information base.

8. Account –
 The information base administration framework is utilized for putting away data about
deals, holding and acquisition of monetary instruments, for example, stocks and bonds
in a data set.

9. Online Shopping –
 These days, web-based shopping has become a major pattern. Nobody needs to visit
the shop and burn through their time. Everybody needs to shop through web based
shopping sites, (for example, Amazon, Flipkart, Snapdeal) from home. So all the items
are sold and added uniquely with the assistance of the information base
administration framework (DBMS). Receipt charges, installments, buy data these are
finished with the assistance of DBMS.

10. Human Resource Management –


 Big firms or organizations have numerous specialists or representatives working under
them. They store data about worker’s compensation, assessment, and work with the
assistance of an information base administration framework (DBMS).

11. Manufacturing –
 Manufacturing organizations make various kinds of items and deal them consistently.
To keep the data about their items like bills, acquisition of the item, amount, inventory
network the executives, information base administration framework (DBMS) is
utilized.

12. Airline Reservation System –


 This framework is equivalent to the railroad reservation framework. This framework
additionally utilizes an information base administration framework to store the
records of flight takeoff, appearance, and defer status.

FILE PROCESSING SYSTEM :

 Before DBMS , was invented information was stored using file processing system.
 File Processing System (FPS) is a way of storing, retrieving and manipulating data
which is present in various files.
 Files are used to store various documents. All files are grouped based on their
categories. The file names are very related to each other and arranged properly to
easily access the files.
 In file processing system, if one needs to insert, delete, modify, store or update
data, one must know the entire hierarchy of the files.

EXAMPLES:

CHARACTERISTICS OF DBMS

1. Data stored into Tables: Data is never directly stored into the


database. Data is stored into tables, created inside the database.
DBMS also allows to have relationships between tables which
makes the data more meaningful and connected. You can easily
understand what type of data is stored where by looking at all the
tables created in a database.

2. Reduced Redundancy: In the modern world hard drives are very


cheap, but earlier when hard drives were too expensive,
unnecessary repetition of data in database was a big problem. But
DBMS follows Normalisation which divides the data in such a way
that repetition is minimum.
3. Data Consistency: On Live data, i.e. data that is being continuosly
updated and added, maintaining the consistency of data can
become a challenge. But DBMS handles it all by itself.

4. Support Multiple user and Concurrent Access: DBMS allows


multiple users to work on it(update, insert, delete data) at the same
time and still manages to maintain the data consistency.

5. Query Language: DBMS provides users with a simple Query


language, using which data can be easily fetched, inserted, deleted
and updated in a database.

6. Security: The DBMS also takes care of the security of data,


protecting the data from un-authorised access. In a typical DBMS,
we can create user accounts with different access permissions,
using which we can easily secure our data by restricting user
access.

7. DBMS supports transactions, which allows us to better handle


and manage data integrity in real world applications where multi-
threading is extensively used.

DRAWBACK OF FILE PROCESSING SYSTEM :

1. Duplicate Data

 Data is stored more than once in different files, that means duplicate data
may occur in all these files. Since all the files are independent on each
other so it is very difficult to overcome this error and if anyone finds this
error then it will take time and effort to solve this issue.

 For Example: A student is having record in college library and in


Examination department. Then his name, roll number, fathers name and
class will be same in both the departments. Also these departments are not
dependent on each other. So it create lots of duplicates value about that
student and when he needs any change for his name or class then he has to
go to both the departments to make these changes happen otherwise it
will create problem for him.
2. Inconsistency
 In file processing system, various copies of same data may contain different
values. Data is not consistent in this system, it means if a data item needs
to be changed then all the files containing that data need to be modified. It
may create a risk of out dated values of data.

 For Example: If you change student name in library then his name should be
changed in all the departments related to the student.

3. Accessing Anomalies
 Accessing anomalies means that it is not easy to access data in a desired or
efficient way. It makes supervision of department very difficult. If a user
wants information in a specific manner then he requires creating a program
for it.

 For Example: Let’s say , if admin of the college wants any student
information like his name, fathers name, roll number, marks and class then
program for it is written but if he wants records of whose students whose
numbers are more than 80 percent then he require to create a different
program for it.

4. Poor Data Integrity


 A collection of data is integrated if it meets certain consistency constraints.
A programmer always puts these constraints in the programs by adding
some codes. In File Processing System, poor data integrity often arises and
it becomes very difficult to add new constraints at that time.
 For Example: The maximum marks of the student can never be more than
100.

5. Poor Data Security


 Poor data security is the most threatening problem in File Processing
System. There is very less security in File Processing System as anyone can
easily modify and change the data stored in the files. All the users must
have some restriction of accessing data up to a level.
 For Example: If a student can access his data in the college library then he
can easily change books issued date. Also he can change his fine detains to
zero.


6. Atomicity Problem
 Atomicity is required to save the data values, it means that information is
completely entered or canceled at all. Any system may fail at any time and
at that time it is desired that data should be in a consistent state.

 For Example: If you are buying a ticket from railway and you are in the
process of money transaction. Suddenly, your internet got disconnected
then you may or may not have paid for the ticket. If you have paid then
your ticket will be booked and if not then you will not be charged anything.
That is called consistent state, means you have paid or not. Same atomicity
is not present in File Processing System.

7. Wastage of Labor and Space


 Labor is very costly in this era and no organization can afford wastage of
their precious labor. File Processing System needs lots of copied data in
different files that cause wastage of labor. Also maintaining same data
again and again leads to wastage of space too.

 For Example: Maintaining student’s record in many departments that are


not dependent on each other cause wastage of labor and space.

8. Data Isolation
 Data is isolated in File Processing System and data is stored in different
files. These files can be in different formats. If you want to extract data
from two file then you are required to which part of the file is needed and
how they are related to each other.
 But still in spite of so many disadvantages, File Processing System is still
good for small organizations because it does not require costly softwares
and programmers to handle it.

Advantages of DBMS over File system :

1.Data redundancy and inconsistency –


 Redundancy is the concept of repetition of data i.e. each data may have
more than a single copy. The file system cannot control redundancy of data
as each user defines and maintains the needed files for a specific
application to run. There may be a possibility that two users are
maintaining same files data for different applications. Hence changes made
by one user does not reflect in files used by second users, which leads to
inconsistency of data. Whereas DBMS controls redundancy by maintaining
a single repository of data that is defined once and is accessed by many
users. As there is no or less redundancy, data remains consistent.
2.Data sharing –
 File system does not allow sharing of data or sharing is too complex.
Whereas in DBMS, data can be shared easily due to centralized system.
3.Data concurrency –
 Concurrent access to data means more than one user is accessing the same
data at the same time. Anomalies occur when changes made by one user
gets lost because of changes made by other user. File system does not
provide any procedure to stop anomalies. Whereas DBMS provides a
locking system to stop anomalies to occur.
4.Data searching –
 For every search operation performed on file system, a different application
program has to be written. While DBMS provides inbuilt searching
operations. User only have to write a small query to retrieve data from
database.
5.Data integrity –
 There may be cases when some constraints need to be applied on the data
before inserting it in database. The file system does not provide any
procedure to check these constraints automatically. Whereas DBMS
maintains data integrity by enforcing user defined constraints on data by
itself.
6.System crashing –
 In some cases,systems might have crashes due to various reasons. It is a
bane in case of file systems because once the system crashes, there will be
no recovery of the data that’s been lost. A DBMS will have the recovery
manager which retrieves the data making it another advantage over file
systems.

7.Data security –
 A file system provides a password mechanism to protect the database but
how longer can the password be protected?No one can guarantee that. This
doesn’t happen in the case of DBMS. DBMS has specialized features that
help provide shielding to its data.
DIFFERENCE BETWEEN DBMS VS FILE PROCESSING TEST :

VIEWS OF DATA :

 Views of data refer to the different ways to show the database management
system to the user hiding its complexity.
 Types:
1. Data abstraction
2. Instance and schema
3. Data independence
4. Data models

DATA ABSTRACTION :

 Database systems comprise complex data-structures. In order to make


the system efficient in terms of retrieval of data, and reduce
complexity in terms of usability of users, developers use abstraction
i.e. hide irrelevant details from the users. This approach simplifies
database design. 

 There are mainly 3 levels of data abstraction : 

 Physical: This is the lowest level of data abstraction. It tells us how


the data is actually stored in memory. The access methods like
sequential or random access and file organization methods like B+
trees, hashing used for the same. Usability, size of memory, and the
number of times the records are factors that we need to know while
designing the database. 
Suppose we need to store the details of an employee. Blocks of
storage and the amount of memory used for these purposes are kept
hidden from the user. 

 Logical: This level comprises the information that is actually stored in


the database in the form of tables. It also stores the relationship
among the data entities in relatively simple structures. At this level,
the information available to the user at the view level is unknown. 
We can store the various attributes of an employee and relationships,
e.g. with the manager can also be stored. 
 View: This is the highest level of abstraction. Only a part of the actual
database is viewed by the users. This level exists to ease the
accessibility of the database by an individual user. Users view data in
the form of rows and columns. Tables and relations are used to store
data. Multiple views of the same database may exist. Users can just
view the data and interact with the database, storage and
implementation details are hidden from them. 

INSTANCE AND SCHEMA:

 DBMS INSTANCE:

 Definition of instance: The data stored in database at a particular moment of


time is called instance of database. Database schema defines the variable
declarations in tables that belong to a particular database; the value of these
variables at a moment of time is called the instance of that database
 For example :
lets say we have a single table student in the database, today the table has
100 records, so today the instance of the database has 100 records. Lets say
we are going to add another 100 records in this table by tomorrow so the
instance of database tomorrow will have 200 records in table. In short, at a
particular moment the data stored in database is called the instance, that
changes over time when we add or delete data from the database.

 DBMS SCHEMA :

 Definition of schema: Design of a database is called the schema. Schema is of three


types: Physical schema, logical schema and view schema.

 For example: In the following diagram, we have a schema that shows the
relationship between three tables: Course, Student and Section. The diagram only
shows the design of the database, it doesn’t show the data present in those tables.
Schema is only a structural view(design) of a database as shown in the diagram
below.
 The design of a database at physical level is called physical schema, how the
data stored in blocks of storage is described at this level.
 Design of database at logical level is called logical schema, programmers and
database administrators work at this level, at this level data can be
described as certain types of data records gets stored in data structures,
however the internal details such as implementation of data structure is
hidden at this level (available at physical level).
 Design of database at view level is called view schema. This generally
describes end user interaction with database systems.

DATA DEFINITION COMMANDS :


Data definition commands are used to create, modify and remove database objects
such as schemas, tables, views, indexes etc.
Common Data Definition commands −

Create
The main use of create command is to create a new table in database. It has a
predefined syntax in which we specify the columns and their respective data types.
syntax
CREATE TABLE <TABLE NAME>
( <COLUMN NAME>  <DATA TYPE>,
<COLUMN NAME>  <DATA TYPE>,
<COLUMN NAME>  <DATA TYPE>,
<COLUMN NAME>  <DATA TYPE>
);

Example  
Create a student table with columns student name and roll number.

CREATE TABLE STUDENT


(STUDENT_NAME VARCHAR(30),
ROLL_NUMBER INT
);

Alter
An existing database object can be modified using the alter command. Alter
command can do following changes to any table-

 Add new columns.


 Add new integrity constraints.

 Modify existing columns. 

 Drop integrity constraints.


Syntax
General Syntax of the ALTER command is mentioned below −
For adding a new column

ALTER TABLE <table_name>  ADD  <column_name>

 For renaming a table

ALTER TABLE <table_name>  RENAME To <new_table_name >

For modifying a column

ALTER TABLE <table_name> MODIFY <column_name > <data type >

For deleting a column

ALTER TABLE <table_name> DROP COLUMN <column_name>

Drop
This command can delete an index, table or view. Basically, any component from a
relational database management system can be removed using the  Drop command.
Once the object is dropped, it cannot be reused.

The general syntax of drop command is as follows −

DROP TABLE <table_name>;


DROP DATABASE <database_name>;
DROP TABLE <index_name>;

Truncate
Using the truncate command, all the records in a database are deleted, but the
database structure is maintained.
syntax
TRUNCATE TABLE <table name>

Comment
This command is used to add comments to the data dictionary.
syntax

 Single line comments:  use ‘ --‘ before any text. 


 Multiline comments:  /* comments in between   */
Rename
The rename command renames an object
Syntax
Rename <old name> to <new name>

DATABASE ARCHITECTURE :
A Database Management system is not always directly available for users and
applications to access and store data in it. A Database Management system can
be centralised(all the data stored at one location), decentralised(multiple copies of
database at different locations) or hierarchical, depending upon its architecture.

IT TYPES :

 1-tier DBMS architecture

 2-tier DBMS architecture

 3-TIER DBMS ARCHITECTURE

1-TIER DBMS ARCHITECTURE :

 1 Tier Architecture in DBMS is the simplest architecture of Database in which the


client, server, and Database all reside on the same machine.
 1-tier DBMS architecture also exist, this is when the database is directly
available to the user for using it to store data. Generally such a setup is
used for local application development, where programmers
communicate directly with the database for quick response.

Advantage—
 Fast for a single user because communication with another system is not
necessary.

Disadvantage—
 Completely unscalable. Only one user can access the system at a given
time via the local client.

2-TIER DBMS ARCHITECTURE :

A 2 Tier Architecture in DBMS is a Database architecture where the


presentation layer runs on a client (PC, Mobile, Tablet, etc.), and data is
stored on a server called the second tier. 

 An application interface known as ODBC(Open Database Connectivity)


provides an API that allow client side program to call the DBMS. Most
DBMS vendors provide ODBC drivers for their DBMS.

 Such an architecture provides the DBMS extra security as it is not


exposed to the End User directly.

Advantages:

1. Understanding and maintenances is easier.


Disadvantages:

1. Performance will be reduced when there are more users.

For example
we have a need to save the employee details in database. The two tiers of
two-tier architecture is

1. Database (Data tier)


2. Client Application (Client tier)

So, in client application the client writes the program for saving the record
in SQL Server and thereby saving the data in the database.

3-TIER DBMS ARCHITECTURE :

 3-tier DBMS architecture is the most commonly used architecture for


web applications.

3-Tier database Architecture design is an extension of the 2-tier client-


server architecture. A 3-tier architecture has the following layers:

1. Presentation layer (your PC, Tablet, Mobile, etc.)


2. Application layer (server)
3. Database Server

 The Application layer resides between the user and the DBMS, which is
responsible to communicate the user's request to the database
management system and then send the response from the DBMS to the
user.
 The application layer(business logic layer) also processes functional
logic, constraint, and rules before passing data to the user or down to
the DBMS.

Advantages

 Easy to modify with out affecting other modules


 Fast communication
 Performance will be good in three tier architecture.

Two-Tier Database Architecture Three-Tier Database


S.NO Architecture
It is a Client-Server
1 Architecture. It is a Web-based application.

In two-tier, the application In three-tier, the application


logic is either buried inside logic or process resides in
the user interface on the client the middle-tier, it is
or within the database on the separated from the data and
2 server (or both). the user interface.

Three-tier architecture
Two-tier architecture consists consists of three layers :
of two layers : Client Tier and Client Layer, Business Layer
3 Database (Data Tier). and Data Layer.

It is easy to build and It is complex to build and


4 maintain. maintain.

Two-tier architecture runs Three-tier architecture runs


5 slower. faster.

It is less secured as client can It is secured as client is not


communicate with database allowed to communicate with
6 directly. database directly.

It results in performance loss


whenever the system is run
It results in performance loss on Internet but gives more
whenever the users increase performance than two-tier
7 rapidly. architecture.
Example – Contact Example – Designing
Management System created registration form which
using MS-Access or Railway contains text box, label,
Reservation System, etc. button or a large website on
8 the Internet, etc.

DATA INDEPENDENCE;

You might also like