Chapter-1 (DBMS) (Autosaved)
Chapter-1 (DBMS) (Autosaved)
Chapter-1 (DBMS) (Autosaved)
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:
• 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.
• 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