DBMS PPT 1 ENG
DBMS PPT 1 ENG
DBMS PPT 1 ENG
UNIT 1
DBMS
AND
RELATIONAL
MODEL
TOPIC
Database- System Applications - Purpose of
Database Systems
View of Data
Database Languages
Database Design
Database Engine
Database and Application Architecture
Database Users and Administrators
History of Database Systems
Structure of Relational Databases
Database Schema - Keys - Schema Diagrams
Relational Query Languages - The Relational
Algebra.
File System Approach
Data Structure The information The contained data and There is no predefined
and data have a information have organization for the
predefined organizational properties- but available data and
organization. are different from predefined information in the system or
structured data. database.
Technology Used Structured Data Semi-Structured Data works Unstructured data works on
words on the basis on the basis of Relational the basis of binary data and
of relational Data Framework (RDF) or the available characters.
database tables. XML.
Flexibility The data depends The data is comparatively less Schema is totally absent.
a lot on the flexible than unstructured Thus, it is the most flexible
schema. Thus, data but way more flexible of all.
there is less than the structured data.
flexibility.
Disadvantage of NoSQL
Open source
NoSQL is an open-source database, so there is no reliable standard for
NoSQL yet.
Management challenge
Data management in NoSQL is much more complicated than relational
databases. It is very challenging to install and even more hectic to
manage daily.
GUI is not available
GUI tools for NoSQL database are not easily available in the market.
Backup
Backup is a great weak point for NoSQL databases. Some databases,
like MongoDB, have no powerful approaches for data backup.
The Object-Oriented Databases
The object-oriented databases contain data in
the form of object and classes. Objects are the
real-world entity, and types are the collection
of objects.
An object-oriented database is a combination
of relational model features with objects
oriented principles. It is an alternative
implementation to that of the relational model.
Object-oriented databases hold the rules of
object-oriented programming. An object-
oriented database management system is a
hybrid application.
The object-oriented database model contains
the following properties.
Object-oriented programming
properties
Objects
Classes
Inheritance
Polymorphism
Encapsulation
Graph Databases
Disadvantage of DBMS
Size.
Cost
Complexity
Instance and Schema
Instance:
The data is stored for a particular amount of time and
is called an instance of the database.
A tablew with rows and columns.
Where Rows= Cardinality
Fields= Degree
Degree
C=3
(no. of Columns)
D=5
Schema
A schema can be defined as the design of a
database. The overall description of the
database is called the database schema.
Logical schema :
View schema :
Tasks Performed:
Grant: It is used to give user access
privileges to a database.
Revoke: It is used to take back permissions
from the user.
3. Data Manipulation Language (DML)
Loaded:Â 16.51%
Tasks Performed:
◦Data Integrity
◦Scalability
◦Security
◦Performance
◦Ease of Use
DATABASE
ENGINE
Client 1
Client 3
Database
Client 2
3-Tier Architecture
Goal :
To separate the user applications and physical database
To support DBMS characteristics
Program-data independence
Supporting multiple views of the data
Example:
Any large website on the internet
3 Tier Architecture
Application
Programmer
Temporary
or Database
System Users or
End Users Specialized Administrat
Analyst Casual
users or or (DBA)
Users
Back-End
Developer
Naive users /
Parametric
users
Sophisticate
d users
End Users/Parametric
Users −
End Users
Naive Users Sophisticated
• These naive users are those Users
users who don’t have any • These users
database knowledge. interact with the
• They depend on pre- system without
developed applications like writing a program
Bank Management Systems, and have separate
Library Management databases for
Systems, Hospital personal use. In the
Management Systems, and database, the user
Railway Ticket Booking passes each query
Systems(IRCTC) and get theare two ways
There toto
the query with a
interact
desired result. system − processor.
They use the structure query
language to run the query on the
database.
They use the tool of data analysis
software. For example, data
engineers and data scientists are
Application programmers/Specialized
programmers/Back-End Developer
These programmers write the code for an application program that
uses the database.
The application programmer can make the application according to
user requirements and control software that runs an entire computer
system.
The application program is written in any programming language like
C#, .net, JAVA, etc., and focuses on business, engineering, and
Application
science program. Programmers
types
Computer
Database Software
Web Developers Hardware
Developers Developers
Programmers
Examples :
◦ Content access software
◦ Educational Software
◦ Information Worker Software
◦ Media Development Software
◦ Product Engineering Software
System Analyst
A System Analyst has also known as a business
technology analyst.
These professionals are responsible for the design,
structure, and properties of databases.
The application programmer uses the specifications
provided by the system analyst to construct the
software that is used by end users.
The analyst will gather information from the
shareholders as well as end users to understand their
requirements and translate it into functional
specifications for the new system.
Examples :
◦ They serve as team leaders.
◦ They are responsible for managing projects.
◦ They are the supervisor who manages the lower-level
information Staff.
Database Administrator
(DBA)
The DBA is the group of people that includes
everything required to manage and solve every
complex.
The DBA can easily use the database to find the
information they need and to plan the goal of the
database.
To meet future needs, they are ready for future
scope and provide solutions for end users.
Therefore, they are known for high-level
management.
Example:
◦ To handle the data loss.
◦ To secure the privacy of data.
◦ Monitor the recovery and backup of the database.
Temporary Users/Casual
Users
These users utilize the database for
testing and are only accessible for a
limited time.
According to business requirements, these
users update a little or new information to
the database with the help of a database
administrator.
It helps to maintain the security and
integrity of data.
Example: High-level management people
are temporary users with little knowledge
of DBMS.
History of Database System (DBMS)
The first concept of database introduces in the 1960’s. Lots of work has been done in this field.
Following is the brief history of the database System.
1950’s and early 1960’s
In 1950s magnetic tape was introduced for storage of data
The data storage process consists of reading data from many tapes and writing of data to a new
tape. For input, process punched cards used, and for output, the printer was used. For example,
salary raises were processed. In the tapes, storage data read in sequential order. The size of data
much larger than the main memory. Access to the database was through low-level pointer
operations. Storage detail depended on the type of data to be stored. Thus adding an extra field to
your database requires rewriting the underlying access. A user would need to know the physical
structure of the database in order to query for information. One major benefit was the SABRE
system IBM and American Airline.
1970’s-72’s
In this year two main relational database system was created, which was developed at UBC, and
system R. E.F Codd proposed the relational model for the database in a landmark paper on how to
think about database. This gave a new concept about the database. He disconnects the schema of
a logical organization of a database from physical storage methods. It was also helpful in the
development of SQL/DS. Two major relational database system prototypes were created between
the years 1974 and 1977, and they were the Ingres, which was developed at UBC, and System R,
created at IBM San Jose. Ingres used a query language known as QUEL, and it led to the creation of
systems such as Ingres Corp., MS SQL Server, Sybase, Wang’s PACE, and Britton-Lee. On the other
hand, System R used the SEQUEL query language, and it contributed to the development of
SQL/DS, Oracle, Non-Stop SQL DB2etc
1976
P-Chen introduces a new database model known as ER Entity-Relationship. This design is basically
made to focus on data applications.It gave another important insight into the conceptual data
model. Such a higher level molding allows the designers to focus on the data instead of a logical
structure.
Early 1980’s
SQL(Structured Query Language) became standard.IBM launched DB2.the
development of the IBM PC gave rise to many DB companies and products
such as RIM , OS/2, PARADOX, RBASE, Database Management System also
introduce in this period. The relational database system became a success
as rapid increase in computer sales. This increased the popularity of the
network and hierarchical database models.
Early 1990’s
In early 1990s much work was done on client tools for application as
development such as PowerBuilder.VB (Microsoft), Oracle Developer. The
client-server model for computing became the norm for future business
decisions. The work on the object database system also started in this year.
The more complex database system was introduced at high prices.in this
year new client tools for application development were introduced. A
number of tools for personal productivity such as ODBC and Excel/Access
were also developed.
Mid 1990’s
The usable internet /WWW was introduced in the middle of this year.it
allows remote access to the computer systems. The concept of Web/DB
started to grow. The advancement in the database system was started.
Average desktops users began to use the client-server database.
Late 1990’s
In the late 1990s, the online business was increased
resulting in a rise in demand for internet database
connectors like Active server page, Jave Servlets,
FrontPage, Dream Weaver. Enterprise Java Beans, Oracle
Developer 2000 etc.in this year internet companies
worked for Web/Internet connectors. The open-source
solutions came online with online analytic processing
(OLAP) come of age with many merchants using point-
of-sale (POS) technology on a daily basis.
Early 21st Century
The growth of DB applications continued in the early
21st century. The more interactive application appeared
with the use of PDAs.The main companies that
predominated the large DB market are IBM.Microsoft
and oracle.
Today
Today’s database is used anywhere in our day to day life. In the
present day, there are many new players in the non-relational
database space offering particular solutions. Many powerful
technologies is introduces in the database. The database is very
helpful in every field to keep records save. The quick base is an
online database on a relational database that gives users of any
skill level the ability to create custom applications using the power
of the relational database.
Future Trends
The huge system are appearing and the handling and analyzing
data has become very complex. Large database as genome
project, geological, national security and space exploration data
have been developed. Data mining, data warehousing, data marts
are commonly used techniques today. This trend will continue in
the future.XML with java has become a popular technique. Mobiles
database is now coming to the market in various ways. Distributed
transaction processing is also very popular for business planning in
many areas.
Structure of relational database
Relational databases are the cornerstone of modern data management, playing a pivotal role in storing, organizing, and retrieving vast amounts of information. A relational database management
system (DBMS) employs a well-defined structure that underpins its functionality. In this comprehensive overview, we will delve into the core elements and principles that comprise the structure of
relational databases within a DBMS, shedding light on the key components that enable efficient data storage and manipulation.
key components of structure of relational database
Tables
◦ The Foundation of a Relational Database At the core of a relational database are tables, also known as relations. Each table is a two-dimensional structure composed of rows and columns. The columns define the
attributes or properties of the entities represented in the table, while the rows, also called tuples, contain the actual data. For example, consider a database for a library. You might have a “Books” table with columns like
“Title,” “Author,” “ISBN,” and “Publication Year,” and each row represents a specific book in the library.
Primary Keys
◦ Uniquely Identifying Rows In a relational database, each table should have a primary key, which is a unique identifier for each row. It ensures that no two rows in the table can have the same primary key value, making it
possible to distinguish and access individual records easily. Primary keys can be one or more columns. In the “Books” table, the ISBN column could serve as the primary key, as ISBNs are typically unique to each book.
Foreign Keys
◦ Establishing Relationships Relational databases excel in managing relationships between tables. This is achieved using foreign keys. A foreign key is a column in one table that refers to the primary key in another table. It
establishes a link between the two tables. In our library database, you might have a “Borrowers” table with a primary key “Library Card Number.” The “Books” table can have a foreign key column, e.g., “Borrower ID,” which
references the “Library Card Number” in the “Borrowers” table. This relationship allows you to associate books with specific borrowers.
Normalization
◦ Efficient Data Organization Normalization is a process used to organize data in a relational database efficiently. It minimizes data redundancy and ensures data integrity. It involves breaking down tables into smaller,
related tables and using foreign keys to establish relationships. For instance, instead of having all book information in a single “Books” table, you might have separate tables for “Authors,” “Publishers,” and “Genres,” each
linked to the “Books” table through foreign keys. This prevents data duplication and makes it easier to update information consistently.
SQL
◦ The Language for Database Operations Structured Query Language (SQL) is the standard language used to interact with relational databases. SQL allows you to perform various operations, including data retrieval,
insertion, updating, and deletion. Common SQL commands include SELECT (for querying data), INSERT (for adding new records), UPDATE (for modifying existing data), and DELETE (for removing records). For example, you
can use SQL to retrieve all books authored by a specific author:
SELECT * FROM Books WHERE Author = 'J.K. Rowling';
Indexes
◦ Enhancing Query Performance Indexes are data structures that improve the speed of data retrieval operations, especially for large datasets. An index is created on one or more columns in a table, and it allows the DBMS
to quickly locate rows that match a query’s criteria. In our “Books” table, you might create an index on the “Title” column to speed up searches for books by title.
Transactions
◦ Ensuring Data Consistency A transaction is a sequence of one or more SQL operations that are treated as a single unit of work. They follow the ACID (Atomicity, Consistency, Isolation, Durability) properties, ensuring data
consistency and integrity even in the face of system failures. For instance, when a borrower checks out a book, it involves updating the “Books” table (to mark the book as checked out) and the “Borrowers” table (to record
the transaction). Using transactions ensures that both updates occur together or not at all, preventing inconsistent data.
Security and Access Control
◦ Relational databases implement security mechanisms to control who can access, modify, and delete data. Access control is typically managed through user accounts and roles. Users are assigned specific privileges that
determine their level of access to the database objects. For instance, a librarian might have full access to the “Books” table, while a regular borrower might only have read access.
Data Integrity Constraints
◦ Data integrity constraints are rules defined on the data in the database to maintain data accuracy and consistency. Common constraints include primary key constraints (ensuring uniqueness), foreign key constraints
(enforcing referential integrity), and check constraints (verifying data validity). For instance, you can define a check constraint to ensure that the “Publication Year” in the “Books” table must be within a certain range.
Backup and Recovery
◦ Regular backups of the database are crucial to protect against data loss due to hardware failures, errors, or disasters. Backup strategies include full backups, incremental backups, and transaction log backups. In case of
data corruption or loss, a reliable recovery mechanism
Advantages
Structured Data Storage: Organizes data into tables with rows and columns, providing a structured format for efficient data management.
Data Integrity: Enforces integrity constraints like primary keys and foreign keys to maintain data accuracy and consistency.
Flexibility in Queries: Supports complex queries and transactions, enabling efficient retrieval, updating, and manipulation of data.
Security Features: Offers robust security mechanisms such as authentication, access control, and encryption to protect sensitive data.
Normalization: Reduces redundancy and improves data integrity through normalization techniques, organizing data into logical tables.
SQL Standardization: Utilizes SQL as a standard interface for querying and managing data, facilitating easier adoption and interoperability.
Disadvantages
Scalability Challenges: May encounter limitations in scaling to handle large volumes of data or high transaction loads efficiently.
Performance Overhead: Complex queries and joins can lead to performance issues, requiring optimization efforts to maintain acceptable performance levels.
Data Model Rigidity: Changes to data schema can be challenging to implement due to the rigid structure of relational databases.
Limited Support for Unstructured Data: Not well-suited for storing or querying unstructured data types such as documents or multimedia files.
Cost: Can be expensive to deploy and maintain, especially for large-scale deployments, due to licensing, hardware, and maintenance costs.
Concurrency Control Complexity: Managing concurrent access to data may require complex locking mechanisms, impacting system performance and scalability.
What is a Key?
When we are working with databases, we store data in tables. Tables
are a collection of the same type of record. A table has columns.
A “key” is a field in a table that is used in the identification of
that record.
That seems pretty broad, but that’s because there are different types
of keys.
I mentioned a few of them earlier, so we’ll explain each of them and
what they are used for.
Why should you know about the different types of keys?
First, it helps you communicate with others better. In software
development, there are a range of terms that we have invented or
implemented to describe how something works. This makes it easier
to communicate. Developers use the word “inheritance” instead of
“make this object a sub-type of that object”. The same can be said for
the different types of keys.
Secondly, it will help you consider new ways of designing your
database, especially when deciding on what your primary key would
be. This will make more sense as we look at the different types of
keys.
Different Types of Keys