0% found this document useful (0 votes)
54 views

Database

This document provides an introduction to databases and database management systems (DBMS). It defines what a database is and explains that a DBMS is software used to create and manage databases. The document outlines different types of databases and discusses the advantages of using a DBMS over file-based systems. It also describes some key components of a DBMS, including the database engine, data definition language, data manipulation language, and data administration.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views

Database

This document provides an introduction to databases and database management systems (DBMS). It defines what a database is and explains that a DBMS is software used to create and manage databases. The document outlines different types of databases and discusses the advantages of using a DBMS over file-based systems. It also describes some key components of a DBMS, including the database engine, data definition language, data manipulation language, and data administration.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 36

Database

1 Laboratory
- Introduction to SQL
Ms. Janelli M. Mendez, MIT
Instructor
Introduction to Database
Learning Outcomes
1. Define Database Management System (DBMS) and
database.
2. Describe the advantages and disadvantages of DBMS to
file based system.
3. Explain logical database design and the data models.
4. Define the components of a database management system.
Database
What is a database?
Database is a organized collection of data. For example a
database of a college would be having a collection of data such
as-
1. Personal records of Students
2. Students performance history
3. Teachers data
4. Financial department data etc.
Database Management System(DBMS)
A database management system is a software application which is used for
managing different databases. It helps us to create and manage database. With
the help of DBMS we take care following tasks –
1. Data Security
2. Data Backup
3. Manages huge amount of data
4. Data export & import
5. Serving multiple concurrent database requests
6. Gives us way to manage the data using programming languages.
Purpose of Database System
In the early days, database applications were built on top of file systems
Drawbacks of using file systems to store data:
◦ 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 part of program code
◦ Hard to add new constraints or change existing ones
Purpose of Database System
Drawbacks of using file systems (cont.)
◦ Atomicity of updates
◦ Failures may leave database in an inconsistent state with partial updates carried out
◦ E.g. transfer of funds from one account to another should either complete or not
happen at all
◦ Concurrent access by multiple users
◦ Concurrent accessed needed for performance
◦ Uncontrolled concurrent accesses can lead to inconsistencies
◦ E.g. two people reading a balance and updating it at the same time
◦ Security problems

Database systems offer solutions to all the above problems


Types of Databases
There are two types of databases –
1. Relational Databases
2. Non-relational Databases
3. Object-oriented Databases
4. Distributed Databases
5. Data warehouse
6. NoSQL Databases
7. Graph Databases
8. OLTP Databases
Types of Databases
Relational Databases
In relational database, data is organized in form of tables. A
table contains rows and columns of data. Table has a unique
key to identify each row of the table.
SQL is used to interact with relational databases. We
often refer relational database as SQL database.
Types of Databases
Non-relational Databases
Data is not organized in form of tables. Data is stored in
form of key & value pairs. The examples of non-relational
databases are: JSON & XML.
We cannot interact with non-relational databases using
SQL.
Types of Databases
Object-oriented Databases
Information in an object-oriented database is represented
in the form of objects, as in object-oriented programming.
Distributed Databases
A distributed database consists of two or more files
located in different sites. The database may be stored on
multiple computers, located in the same physical location,
or scattered over different networks.
Types of Databases
Data Warehouses
A central repository for data, a data warehouse is a type of
database specifically designed for fast query and analysis.
NoSQL Databases
A NoSQL, or non-relational database, allows unstructured and
semi-structured data to be stored and manipulated (in contrast to
a relational database, which defines how all data inserted into the
database must be composed). NoSQL databases grew popular as
web applications became more common and more complex.
Types of Databases
Graph Databases
A graph database stores data in terms of entities and the
relationships between entities.
OLTP Databases
An OLTP database is a speedy, analytic database designed
for large numbers of transactions performed by multiple
users.
Advantages of DBMS
•DBMS offers a variety of techniques to store & retrieve data.
•DBMS serves as an efficient handler to balance the needs of multiple applications using the
same data.
•Uniform administration procedures for data.
•Application programmers never exposed to details of data representation and storage.
•A DBMS uses various powerful functions to store and retrieve data efficiently.
•Offers Data Integrity and Security.
•The DBMS implies integrity constraints to get a high level of protection against prohibited
access to data.
•A DBMS schedules concurrent access to the data in such a manner that only one user can
access the same data at a time.
•Reduced Application Development Time.
Disadvantages of DBMS
• Cost of Hardware and Software of a DBMS is quite high which increases the budget
of your organization.

• Most database management systems are often complex systems, so the training for
users to use the DBMS is required.

• In some organizations, all data is integrated into a single database which can be
damaged because of electric failure or database is corrupted on the storage media.

• Use of the same program at a time by many users sometimes lead to the loss of some
data.

• DBMS can't perform sophisticated calculations.


Why Use a DBMS?
•Separation of the Data definition and the Program.
•Abstraction into a simple model.
•Data independence and efficient access.
•Reduced application development time –ad-hoc queries.
•Data integrity and security.
•Uniform data administration.
•Concurrent access, recovery from crashes.
•Support for multiple different views.
Why Study Databases?
•Shift from computation to information.
•Datasets increasing in diversity and
volume.
•DBMS encompasses most of CS.
Instances and Schemas
Similar to types and variables in programming languages

Schema – the logical structure of the database


• e.g., the database consists of information about a set of customers and accounts and the
relationship between them)
• Analogous to type information of a variable in a program
• Physical schema: database design at the physical level
• Logical schema: database design at the logical level

Instance – the actual content of the database at a particular point in time


• Analogous to the value of a variable

Physical Data Independence – the ability to modify the physical schema without
changing the logical schema
• Applications depend on the logical schema
• In general, the interfaces between the various levels and components should be well defined
so that changes in some parts do not seriously influence others.
Logical Database Design
Physical view
• Involves how data is stored on and retrieved from
storage media
◦ Hard disks, magnetic tapes, or CDs

Logical view
• Involves how information appears to users and
how it can be organized and retrieved
• Includes more than one logical view of data,
depending on the user
Data Models
•Hierarchical Model
•Entity-Relationship Model
•Relational Model
•Network Model

• Other Data Models


Object-oriented data model
Object-relational data model
Data Models
Data model
◦ Determines how data is created, represented,
organized, and maintained
◦ Contains
◦ Data structure
◦ Operations
◦ Integrity rules
Hierarchical model
◦ Relationships between records form a treelike
Data Models
Hierarchical Model

Example of Hierarchical model.


Data Models
Entity-Relationship Model
E-R model of real world
• Entities (objects)
◦ E.g. customers, accounts, bank branch
• Relationships between entities
◦ E.g. Account A-101 is held by customer Johnson
◦ Relationship set depositor associates customers with accounts

Widely used for database design


• Database design in E-R model usually converted to design in the
relational model (coming up next) which is used for storage and
processing
Data Models
Entity-Relationship Model

Example of schema in the Entity-Relationship Model.


Data Models
Relational Model
Uses a two-dimensional table of rows and columns of
data
• Rows are records
• Columns are fields

Data dictionary: Stores definitions


• Data types for fields, default values, and
validation rules for data in each field
Data Models
Relational Model

Example of tabular data in the relational model. Attributes

customer_ID customer_name customer_street customer_city account_number


192-83-7465 Johnson Alma Palo Alto A-101
019-28-3746 Smith North Rye A-215
192-83-7465 Johnson Alma Palo Alto A-201
321-12-3123 Jones Main Harrison A-217
019-28-3746 Smith North Rye A-201
A Sample of Relational Model
Data Models

Network Model
• Similar to the hierarchical model but
records are organized differently
• Includes multiple parent and child
records
Sample of Network Model
Components of DBMS
•Database Engine
•Data Definition Language
•Data Manipulation Language
•Application Generation
•Data Administration
Components of DBMS
Database Engine
•Heart of DBMS software
•Responsible for data storage, manipulation, and retrieval
•Converts logical requests from users into their physical
equivalents
• By interacting with other components of the DBMS
Components of DBMS
Data Definition Language
•Creates and maintains the data dictionary
•Defines the structure of files in a database
•Makes changes to a database’s structure
• Adding and deleting fields
• Changing field size and data type
Components of DBMS
Data Manipulation Language
•Used to add, delete, modify, and retrieve records from a database
•Uses a query language
• Structured Query Language (SQL)
◦ Standard fourth-generation query language that consists of several keywords
specifying actions to take
• Query by example (QBE)
◦ Involves requesting data from a database by constructing a statement formed by query
forms
Components of DBMS
Application Generation
•Designs elements of an application using a database
• Data entry screens
• Interactive menus
• Interfaces with other programming languages

•Used by IT professionals and database administrators


Components of DBMS
Data Administration
Used for the tasks backup and recovery,
security, and change management
Used to determine who has permission to
perform certain functions
• Summarized as create, read, update, and delete
(CRUD)
History of Database Management System
•Here, are the important landmarks from the history:
•1960 - Charles Bachman designed first DBMS system.
•1970 - Codd introduced IBM'S Information Management System (IMS).
•1976 - Peter Chen coined and defined the Entity-relationship model also know as
the ER model.
•1980 - Relational models becomes a widely accepted database component.
•1985 - Object-oriented DBMS develops.
•1990 - Incorporation of object-orientation in relational DBMS.
•1991 - Microsoft ships MS access, a personal DBMS and that displaces all other
personal DBMS products.
•1995 - First Internet database applications.
•1997 - XML applied to database processing. Many vendors begin to integrate
XML into DBMS products.
THANK YOU!
NEXT TOPIC:

You might also like