Chapter-1 (DBMS) (Autosaved)

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 23

Chapter-1

1) Introduction to Database System


1.1 Concept of Data, Information, Database and Database Management
System
1.2 Limitations of File System
1.3 Advantages and Disadvantages of Database System
1.4 Application of Database System
1.5 Types of Database Users
1.6 DBMS Architecture
1.7 Database Model
1.8 Database Schema
What is data?
• Data is a collection of raw and unorganized facts that include words,
numbers, sound and images.
• Example:-
Ram,20,Hari,35,Kathmandu,Butwal,1,2,etc.
What is information?
• The meaningful and organized form of data is called information.
• Example:-
S.N. Name Address Age
1 Hari Butwal 20
2 Ram Kathmandu 35
What is database and DBMS?
• The collection of information that is organized and can be easily
accessed, managed and updated by users is called database.
• DBMS is a application that is designed to store, access, and modify
the information in a database.
• Example of DBMS:-
MySQL, Oracle, Microsoft Access, etc.
What is File System?
• File system is basically a way of arranging the files in a storage
medium like a hard disk.
• The file system organizes the files and helps in the retrieval of files
when they are required.
• File systems consist of different files which are grouped into
directories. The directories further contain other folders and files.
Term used in file system and dbms.
1) Concurrency:-
Enabling two or more users to retrieve information from the database at the same time without affecting
data integrity.
2) Data Integration:-
The process of combining data from multiple sources into a single database to a complete, accurate, and
up-to-date dataset.
3) Data Inconsistency:-
It is a situation or condition where there are multiple tables within a database that deal with the same data
but may receive it from different inputs.
4) Data Redundancy:-
It is a process which occurs when the same data is stored in multiple places within a database.
5) Data Security:-
Protecting sensitive data and information stored in a database from unauthorized access, misuse, or
destruction.
6) Atomicity:-
The property that ensures that all commands that make up a transaction are treated as a single unit. This
means that either all the commands succeed or all fail together.
Data access in file system
Consider an example of a student's file system. The student file will contain information regarding the student (i.e. roll no, student
name, course etc.). Similarly, we have a subject file that contains information about the subject and the result file which contains the
information regarding the result. This file can be stored many times, which leads to data redundancy.
Data access in DBMS
A database approach is a well-organized collection of data that are
related in a meaningful way which can be accessed by different users but
stored only once in a system.
Concurrency
• Enabling two or more users to retrieve information from the database
at the same time.
Atomicity
The property that ensures that all commands that make up a transaction are treated as a
single unit. This means that either all the commands succeed or all fail together i.e. ALL or
Nothing.

Example:-
Steps for ATM Transaction
1. Transaction Start.
2. Insert your ATM card.
3. Select a language for your transaction.
4. Select the Savings Account option.
5. Enter the amount you want to withdraw.
6. Enter your secret pin.
7. Wait for some time for processing.
8. Collect your Cash.
9. Transaction Completed
If any of these step fail due to error or cancellation then the user have to repeat all this above steps.
Limitation of File System:-
• Data inconsistency:
In file system same data can be stored in multiple places but those data may contain different values which lead to
inconsistency.
• Data redundancy:
In file system when the user try to store or save the data, then mistakenly he could copy same data multiple times or
when the user get data from multiple resources data redundancy may occur.
• Difficulty in accessing data:
Before the arrival of DBMS, data were processed using file processing system. File processing system consists of
several application programs and each application program has its own data stored in private files. Difficulty in accessing data
arises whenever there is no application program for a specific task.
• Data isolation:
Data is scattered in different files, and files may be in different formats, making it difficult to retrieve the
appropriate data.
• Concurrency:
Multiple users can’t access data at the same time in file system.
• Data integrity:
File system doesn’t provide accurate and up-to data because of data redundancy and inconsistency.
• Security:
Traditional file environments don't help manage data to avoid data breaches.
Disadvantages of Database Systems
1. Database Complexity
The design of the database system is complex, difficult and is very time consuming task to perform.
2. Substantial hardware and software start-up costs
Huge amount of investment is needed to setup the required hardware and the software's needed to run
those applications.
3. Damage to database affects virtually all applications programs
If one part of the database is corrupted or damaged because of the hardware or software failure, since we
don’t have many versions of the file, all the application programs which are dependent on this database are
implicitly affected.
4. Extensive conversion costs
In moving form a file-based system to a database system If you are currently working on file based system
and need to upgrade it to database system, then large amount of cost is incurred in purchasing different tools,
adopting different techniques as per the requirement.
5. Initial training required
For all programmers and user. Large amount of human efforts, the time and cost is needed to train the end
users and application programmers in order to get used to the database systems.
Data base system applications:

• Universities: For student information, course details, and grades.

• Airlines: For reservations and schedule information.

• Credit card transactions: For purchase on credit cards and generations of monthly
statements.

• Human resources: For information about employees, salaries, payroll taxes, benefits and for
generations of paychecks.

• Banking: For customer information, accounts, and banking transactions.


Dbms Architecture
1 Tier Architecture (Single Tier Architecture)
• The simplest form of DBMS architecture is the 1-tier DBMS design, where all DBMS components reside on a
single server or platform, allowing direct access to the database by end users.
• Any edits made by the client are reflected directly in the database in this structure, and all processing is done
on a single server. Furthermore, no network connection is required to execute database tasks.

A 1 tier architecture is suitable when:-


• The information is not updated frequently.
• The database system is not being visited by many users.
2 Tier Architecture

• In DBMS 2 tier architecture refers to a client-server architecture where the user interface and the
application logic are separated into two separate components.
• The client component is typically the user interface and the server component is responsible for
handling the data and business logic.
• In this architecture, the client component communicates directly with the server component to
request data and perform actions
• Example:- Physically booking train ticket, air-line ticket, requesting account detail in bank, etc.
• Advantages:- Disadvantages:-
1)Maintenance 1)Scalability 2)Security
3-tier architecture
• In 3-tier there is another layer exists between the client and server. The client cannot
communicate directly with the server with this design.

• On the client side, the program communicates with an application server, which then
communicates with the database system.
• Beyond the application server, the end-user has no knowledge of the database’s
existence. Aside from the application, the database has no knowledge of any other users.
• Example:-To find movie in your area using a web application.
Types of Database Users
Database users are categorized based on their interaction and experties with
the database. Below mentioned are the types of database users:-

1. Database Administrator (DBA):-DBA has the complete control over Database .DBA is responsible for overall
performance of Database. Administrator is free to take decision for db and also provide technical support.
So, DBA has lots of responsibilities.
2. Application programmer:- They are s/w developers who develops application user interface by having
knowledge of programming languages like c, c++,java, etc.
3. Database Designer:-They are responsible on providing a design of how the data is displaced, how the data is
stored and how the data is defined i.e. structured, unstructured or semi-structured.
4. End users:- They may or may not have idea about db. They are categorized as follows:-
a. Naïve users:- They don’t have any idea about db and access the data by using menu oriented interface.
Example:- bank clerk.
b. Sophisticated user:- Sophisticated users can be engineers, scientists, business analyst, who are familiar with
the database. They can develop their own database applications according to their requirement. They don’t
write the program code but they interact the database by using queries.
c. Specialized user:- Specialized users are sophisticated users who write specialized database application that
does not fit into the traditional data-processing framework. Among these applications are computer aided-
design systems, knowledge-base and expert systems, etc.
Dbms Model
1. Hierarchical Model

2. Network Model

3. Entity-relationship Model

4. Relational Model

5. Object-oriented Model
Hierarchical Model:-
• The hierarchy 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.
• Data is organized into a tree-like structure with a one-to-many relationship.
• Example: We can represent the relationship between the shoes present on a
shopping website in the following way:-
Network Model
• The Network Model is an extension of the Hierarchical model.
• In this model, data is organized more like a graph, and allowed to have more than one parent node.
• In the network 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 uses many-to-many data relationships.
Entity-relationship Model

• In this model, we represent the real-world problem in the pictorial form to make it easy for the
stakeholders to understand. It is also very easy for the developers to understand the system by just
looking at the ER diagram.
• ER diagram has the following three components:
• Entities: Entity can be a person, place, or even a concept. Example: Teachers, Students, Course,
Building, Department, etc. are some of the entities of a School Management System.
• Attributes: An attribute is the characteristics of an entity. Example: The entity teacher has the property
like teacher id, salary, age, etc.
• Relationship: Relationship tells how the attributes are related. Example: Teacher works for a
department.
Relational Model
• Relational Model is the most widely used model. In this model, the data is maintained in the form of a two-
dimensional table.
• All the information is stored in the form of row and columns. The basic structure of a relational model is
tables. So, the tables are also called relations in the relational model.
• Each row in the table is called tuple. A row contains all the information about any instance of the object.
• Each column in the table is called Attribute or field. Attributes are the property which defines the table or
relation. The values of the attribute should be from the same domain.
Object-oriented Model

• In this model, data is stored in the form of objects.


• The behavior of the object-oriented database model is just like object-
oriented programming.
• A very popular example of an Object Database management system
or ODBMS is MongoDB which is also a NoSQL database.

You might also like