Ch1 Introduction
Ch1 Introduction
SEM -III
Instructor:
Prof.Rajul Suthar
[email protected]
Chapter 1: Introduction
What is Database?
• The database is a collection 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.
• For example: The University Database (admin, staff, students and
faculty etc.)
What Is a DBMS?
• A database is a collection of data elements (facts) stored in a
computer in a systematic way, such that a computer program
can consult it to answer questions.
• The answers to those questions become information that
can be used to make decisions that may not be made with
the data elements alone.
• The computer program used to manage and query a
database is known as a database management system
(DBMS)
• Database management system is software that is used to
manage the database.
• For example: MySQL, Oracle,
Using DBMS users can perform following tasks:
1.Data Definition: In the context of SQL, data definition or data
description language (DDL) is a syntax for creating database objects such as tables, indices, and users.
• DDL statements are similar to a computer programming language for defining data structures, especially
database schemas.
2.Updation: is a computer programming language used for adding (inserting), deleting, and modifying (updating)
data in a database.
A DML is often a sublanguage of a broader database language such as SQL, with the DML comprising some of the
operators in the language
3.Data Retrieval:It is used to retrieve the data from the database which can be used by applications for various
purposes.
4.User Administration:It is used for registering and monitoring users, maintain data integrity, enforcing data
security, dealing with concurrency control, monitoring performance and recovering information corrupted by
unexpected failure.
What is File? Drawbacks of using file systems to store data
• File is a collection of related data stored in secondary memory like in ‘HDD’
• Data redundancy and inconsistency
• Multiple file formats, duplication of information in different files
• Difficulty in accessing data
• Need to write a new program to carry out each new task
• Data isolation
• Multiple files and formats
• Integrity problems
• Integrity constraints (e.g., account balance > 0) become “buried” in program code
rather than being stated explicitly
• Hard to add new constraints or change existing ones
Drawbacks of using file systems to store data (Cont.)
• Atomicity of updates
• Failures may leave database in an inconsistent state with partial
updates carried out
• Example: Transfer of funds from one account to another should
either complete or not happen at all
• Concurrent access by multiple users
• Concurrent access needed for performance
• Uncontrolled concurrent accesses can lead to inconsistencies
• Example: Two people reading a balance (say 100) and updating it by withdrawing
money (say 50 each) at the same time
• Security problems
• Hard to provide user access to some, but not all, data
Database systems offer solutions to all the above problems
Why Use a DBMS?
• Data independence and efficient access.
• Reduced application development time.
• Data integrity and security.
• Uniform data administration.
• Concurrent access, recovery from
crashes.
The various reasons a database is important are
Data Models
• A data model is a collection of high level concepts for describing data.
• A schema is a description of a particular collection of data, using the a given
data model.
• The relational model of data is the most widely used model today.
• Main concept: relation, basically a table with rows and columns. A set of
records
• Every relation has a schema, which describes the columns, or fields.
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 system.
TYPES OF DATABASE (MODEL)
You can get the complex data structure details at this level.
2-Tier Architecture
3-Tier Architecture
Data Independence
• Data independence can be explained using the three-schema architecture.
• Data independence refers characteristic of being able to modify the schema at one level of the database
system without altering the schema at the next higher level.
There are two types of data independence:
1. Logical Data Independence
•Logical data independence refers characteristic of being able to change the conceptual schema
without having to change the external schema.
•Logical data independence is used to separate the external level from the conceptual view.
•If we do any changes in the conceptual view of the data, then the user view of the data would not be
affected.
•Logical data independence occurs at the user interface level.
Data elements need to access individually. Multiple data elements can be accessed at the same time.
No relationship between data. Data is stored in the form of tables which are related to each other.
Normalization is not present. Normalization is present.
DBMS does not support distributed database. RDBMS supports distributed database.
It uses a tabular structure where the headers are the column names,
It stores data in either a navigational or hierarchical form.
and the rows contain corresponding values.
It deals with small quantity of data. It deals with large amount of data.
Data redundancy is common in this model. Keys and indexes do not allow Data redundancy.
It is used for small organization and deal with small data. It is used to handle large amount of data.
It supports single user. It supports multiple users.
Data fetching is slower for the large amount of data. Data fetching is fast because of relational approach.
The data in a DBMS is subject to low security levels with regards to
There exists multiple levels of data security in a RDBMS.
data manipulation.
Low software and hardware necessities. Higher software and hardware necessities.
Examples: XML, Window Registry, etc. MySQL, PostgreSQL, SQL Server, Oracle, Microsoft Access etc.
Advantages of DBMS
• Control redundancy
• Consistency
• Integrity
• Security
• Concurrency control
• Backup & recovery
• Data standard
• More information
• Data sharing & conflict control
• Productivity & accessibility
• Economy of scale
• Maintenance
Limitations of DBMS
• Complexity
• Size
• Cost
• Software
• Hardware
• Conversion
• Performance
• Vulnerability