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

Module 1-Introduction To Database Concepts

Uploaded by

Ayush Sinha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
284 views

Module 1-Introduction To Database Concepts

Uploaded by

Ayush Sinha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 75

Module 1

INTRODUCTION TO DATABASE CONCEPTS

Prepared by Ms. Jisha Tinsu


CONTENTS
▪ Introduction

▪ Characteristics of databases,

▪ File system V/s Database system,

▪ Users of a Database system

▪ Data Models, Schemas, and Instances,

▪ Three-Schema Architecture and Data Independence,

▪ Database Administrator (DBA), Role of a DBA

JT 22-07-2024 2
INTRODUCTION
▪ A database-management system ( DBMS ) is a collection of interrelated data and a set
of programs to access those data.

▪ The primary goal of a DBMS is to provide a way to store and retrieve database
information that is both convenient and efficient.

▪ Management of data involves both defining structures for storage of information and
providing mechanisms for the manipulation of information.

▪ In addition, the database system must ensure the safety of the information stored,
despite system crashes or attempts at unauthorized access.

JT 22-07-2024 3
WHY DATABASE?
▪ Information is a very valuable resource (some say, information is power!). Its storage

and retrieval is important.

▪ A common approach for storing and retrieving information is to build a database.

▪ Virtually every medium to large enterprise uses one or more databases. For example:
▪ Libraries
▪ Airlines
▪ Banks
▪ Most web sites (e.g. Amazon or Google)

JT 22-07-2024 4
PURPOSE OF DATABASE SYSTEMS
▪ The purpose of DBMS is to transform the following −

✓ Data into information.

✓ Information into knowledge.

✓ Knowledge to the action.

▪ The diagram given alongside explains the process as

to how the transformation of data to information to


knowledge to action happens respectively in the
DBMS −

JT 22-07-2024 5
WHAT IS DATA?
▪ Data is a collection of a distinct small unit of information.

▪ It can be used in a variety of forms like text, numbers, media, bytes, etc. it can be
stored in pieces of paper or electronic memory, etc.

▪ Word 'Data' is originated from the word 'datum' that means 'single piece of information’.
It is plural of the word datum.

▪ In computing, Data is information that can be translated into a form for efficient
movement and processing.

▪ Data is interchangeable.

JT 22-07-2024 6
WHAT IS DATABASE?
▪ A database is an organized collection of data, so that it can be easily accessed and managed.You
can organize data into tables, rows, columns, and index it to make it easier to find relevant
information.

▪ Database handlers create a database in such a way that only one set of software program
provides access of data to all the users. The main purpose of the database is to operate a large
amount of information by storing, retrieving, and managing data.

▪ There are many dynamic websites on the World Wide Web nowadays which are handled through
databases. For example, a model that checks the availability of rooms in a hotel. It is an example
of a dynamic website that uses a database.

▪ There are many databases available like MySQL, Sybase, Oracle, MongoDB, Informix,
PostgreSQL,
JT
SQL Server, etc. 22-07-2024 7
WHAT IS DATABASE?
Although the term database is commonly used, its meaning is not always clear.

A database may be defined as a well organised collection of data that are


related in a meaningful way which can be accessed in different logical
orders but are stored only once.

JT 22-07-2024 8
PURPOSE OF DATABASE SYSTEMS
▪ Programming languages cannot store data permanently. For this purpose we have to

use the Database Management System. The DBMS plays a significant role in storing and
managing data.

▪ To understand the need for database system, we need to study the drawbacks of File

Processing System.

JT 22-07-2024 9
DRAWBACKS OF FILE PROCESSING SYSTEM
▪ 1. Data redundancy and inconsistency: Different file formats, duplication of
information in different files.
The various files are likely to have different formats and the programs may be written
in several programming languages. Moreover, the same information may be duplicated
in several places (files). For example, the address and telephone number of a particular
customer may appear in a file that consists of savings-account records and in a file that
consists of checking-account records. This redundancy leads to higher storage and
access cost. In addition, it may lead to data inconsistency; that is, the various copies of
the same data may no longer agree.

JT 22-07-2024 10
DRAWBACKS OF FILE PROCESSING SYSTEM
▪ 2. Difficulty in accessing data: To carry out new task we need to write a new program. i.e., The
conventional file system does not allow to retrieve the desired data in efficient and convenient
manner.

▪ 3. Data isolation: Because data are scattered in various files, and files may be in different formats,
writing new application programs to retrieve the appropriate data is difficult.

▪ 4. Integrity problems: The data values stored in the database must satisfy certain types of
consistency constraints. For example, the balance of a bank account may never fall below a
prescribed amount (say, $25). Developers enforce these constraints in the system by adding
appropriate code in the various application programs. However, when new constraints are added, it is
difficult to change the programs to enforce them. The problem is compounded when constraints
involve several data items from different files.

JT 22-07-2024 11
DRAWBACKS OF FILE PROCESSING SYSTEM
▪ 5. Atomicity problems: Failures leave the database in an inconsistent state.

For example, the fund transfer from one account to another may be incomplete. Consider a
program to transfer $50 from account A to account B. If a system failure occurs during the
execution of the program, it is possible that the $50 was removed from account A but was not
credited to account B, resulting in an inconsistent database state.

▪ 6. Concurrent-access anomalies: For the sake of overall performance of the system and
faster response, many systems allow multiple users to update the data simultaneously. In such
an environment, interaction of concurrent updates may result in inconsistent data.
Consider bank account A, containing $500. If two customers withdraw funds (say $50 and $100
respectively) from account A at about the same time, the result of the concurrent executions
mayJT leave the account in an incorrect (or inconsistent) state. 22-07-2024 12
DRAWBACKS OF FILE PROCESSING SYSTEM
▪ 7. Security problems: It is very difficult to enforce security checks and access rights

in the traditional file system. We can add password protections though!!

JT 22-07-2024 13
DATABASE SYSTEM TERMINOLOGIES
▪ Data: Meaningful facts, text, graphics, images, sound, video segments etc.

▪ Database: An organized collection of logically related data.

▪ Information: Data processed to be useful in decision making.

▪ Metadata: Data that describes data.

▪ Keys: A key is an entity's or an entity instance's particular set of properties that

uniquely identify it. For data integrity and effective data retrieval, keys are
necessary.
JT 22-07-2024 14
DATABASE: WHAT??

JT 22-07-2024 15
DATABASE CHARACTERISTICS
▪ Self-describing nature of a database system: A DBMS catalogue stores the

description of the database. (The description is called meta-data). This allows the DBMS
software to work with different databases.

▪ Insulation between programs and data: Called program-data independence.

Allows changing data storage structures and operations without having to change the
DBMS access programs.

▪ Data Abstraction: A data model is used to hide storage details and present the users

with a conceptual view of the database.

JT 22-07-2024 16
DATABASE CHARACTERISTICS
▪ Support of multiple views of the data: Each user may see a different view of the

database, which describes only the data of interest to that user.

▪ Sharing of data and multi-user transaction processing: allowing a set of

concurrent users to retrieve and to update the database. Concurrency control within the
DBMS guarantees that each transaction is correctly executed or completely aborted.

JT 22-07-2024 17
JT 22-07-2024 18
FILE SYSTEM VS. DBMS
▪ 1. File System :

▪ File system is basically a way of arranging the files in a storage medium like hard disk.

▪ File system organizes the files and helps in retrieval of files when they are required.

▪ File systems consists of different files which are grouped into directories.

▪ The directories further contain other folders and files.

▪ File system performs basic operations like management, file naming, giving access rules

etc.

JT 22-07-2024 19
EXAMPLE
NTFS(New Technology File System), EXT(Extended File System).

JT 22-07-2024 20
FILE SYSTEM VS. DBMS
2. DBMS (Database Management System)

▪ Database Management System is basically a software that manages the collection of related

data.

▪ It is used for storing data and retrieving the data effectively when it is needed.

▪ It also provides proper security measures for protecting the data from unauthorized access.

▪ In Database Management System the data can be fetched by SQL queries and relational algebra.

▪ It also provides mechanisms for data recovery and data backup.

JT 22-07-2024 21
EXAMPLE
Oracle, MySQL, MS SQL server.

JT 22-07-2024 22
DIFFERENCE BETWEEN FILE SYSTEM AND DBMS

JT 22-07-2024 23
APPLICATION AREAS OF DBMS
▪ Airlines and Railways

JT 22-07-2024 24
APPLICATION AREAS OF DBMS
▪ E-Commerce

JT 22-07-2024 25
APPLICATION AREAS OF DBMS
▪ Banking

JT 22-07-2024 26
APPLICATION AREAS OF DBMS
▪ Education

JT 22-07-2024 27
APPLICATION AREAS OF DBMS
▪ Telecommunications

JT 22-07-2024 28
APPLICATION AREAS OF DBMS
▪ Health care information systems and electronic patient record

JT 22-07-2024 29
APPLICATION AREAS OF DBMS
▪ Digital libraries

JT 22-07-2024 30
EXAMPLES OF VERY LARGE DATABASES
▪ Google, Yahoo and MSN – The search engine market in India has been estimated to be
growing by more than 90% annually

▪ YouTube –15.5 million visitors in a month in India. There is a large number of videos on
YouTube

▪ Facebook – 18.7 million unique visitors in India in the month of May 2010. Indian user
database is growing at 12% a month! Around 30 billion photos are uploaded to Facebook
in a year.

▪ Wikipedia – a very large collection of documents.

▪ Flickr - has more than four billion photos.


JT 22-07-2024 31
32
USERS OF A DATABASE
SYSTEM

JT 22-07-2024
USERS OF DATABASE SYSTEM
▪ There are four different types of database-
system users. Different types of user
interfaces have been designed for the
different types of users.

▪ 1. Naive users

▪ 2. Application programmers

▪ 3. Sophisticated users

▪ 4. Specialized users

JT 22-07-2024 33
USERS OF A DATABASE SYSTEM
• Database administrators

• Database designers

• System analysts and application programmers

• End users

• Naive and sophisticated users

• Workers behind the scene

JT 22-07-2024 34
DATABASE SYSTEM ENVIRONMENT

JT 22-07-2024 35
USERS OF A DATABASE SYSTEM
❑Database Administrator (DBA) :

▪ Database Administrator (DBA) is a person/team who defines the schema and also controls the 3 levels of

database.

▪ The DBA will then create a new account id and password for the user if he/she need to access the data

base.

▪ DBA is also responsible for providing security to the data base and he allows only the authorized users to

access/modify the data base.

▪ DBA also monitors the recovery and back up and provide technical support.

▪ The DBA has a DBA account in the DBMS which called a system or superuser account.

▪ DBA repairs damage caused due to hardware and/or software failures.

JT 22-07-2024 36
USERS OF A DATABASE SYSTEM
❑Naive/Parametric End Users

▪ Parametric End Users are the unsophisticated who don’t have any DBMS knowledge but they

frequently use the data base applications in their daily life to get the desired results.

▪ For examples, Railway’s ticket booking users are naive users.

▪ Clerks in any bank is a naive user because they don’t have any DBMS knowledge but they still

use the database and perform their given task.

JT 22-07-2024 37
USERS OF A DATABASE SYSTEM
❑System Analyst :

▪ System Analyst is a user who analyzes the requirements of parametric end users.

▪ They check whether all the requirements of end users are satisfied.

❑Sophisticated Users :

▪ Sophisticated users can be engineers, scientists, business analyst, who are familiar with the
database.

▪ They can develop their own data base applications according to their requirement.

▪ They don’t write the program code but they interact the data base by writing SQL queries
directly through the query processor.

JT 22-07-2024 38
USERS OF A DATABASE SYSTEM
❑ Database Designers

▪ Data Base Designers are the users who design the structure of data base which
includes tables, indexes, views, constraints, triggers, stored procedures.
▪ He/she controls what data must be stored and how the data items to be related.

❑ Application Program
▪ Application Program are the back-end programmers who writes the code for the
application programs.
▪ They are the computer professionals.

▪ These programs could be written in Programming languages such as Visual Basic,


Developer, C, FORTRAN, COBOL etc.
JT 22-07-2024 39
USERS OF A DATABASE SYSTEM
❑Casual Users / Temporary Users

▪ Casual Users are the users who occasionally use/access the data base but each time

when they access the data base they require the new information, for example,
Middle or higher level manager.

JT 22-07-2024 40
ADVANTAGES OF USING A DBMS
▪ Redundancies and inconsistencies can be reduced

▪ Better service to the users

▪ Flexibility of the system is improved

▪ Cost of developing and maintaining systems is lower

▪ Standards can be enforced

▪ Security restrictions can be applied

▪ Integrity can be maintained

JT 22-07-2024 41
42
DATABASE ARCHITECTURE

JT 22-07-2024
DBMS ARCHITECTURE 1-LEVEL, 2-LEVEL, 3-LEVEL
▪ A Database stores a lot of critical information to access data quickly and securely.

▪ Hence it is important to select the correct architecture for efficient data management.

▪ DBMS Architecture helps users to get their requests done while connecting to the
database.

▪ We choose database architecture depending on several factors like the size of the
database, number of users, and relationships between the users.

▪ There are two types of database models that we generally use, logical model and
physical model.

JT 22-07-2024 43
TYPES OF DBMS ARCHITECTURE
▪ There are several types of DBMS Architecture that we use according to the usage

requirements. Types of DBMS Architecture are discussed here.

❑1-Tier Architecture

❑2-Tier Architecture

❑3-Tier Architecture

JT 22-07-2024 44
1-TIER ARCHITECTURE
▪ In 1-Tier Architecture the database is directly
available to the user, the user can directly sit on
the DBMS and use it that is, the client, server, and
Database are all present on the same machine.

▪ For Example: to learn SQL we set up an SQL


server and the database on the local system.

▪ This enables us to directly interact with the relational database and execute operations.
▪ The industry won’t use this architecture they logically go for 2-tier and 3-tier
Architecture.
JT 22-07-2024 45
ADVANTAGES OF 1-TIER ARCHITECTURE
▪ Simple Architecture: 1-Tier Architecture is the simplest architecture to set up, as only

a single machine is required to maintain it.

▪ Cost-Effective: No additional hardware is required for implementing 1-Tier


Architecture, which makes it cost-effective.

▪ Easy to Implement: 1-Tier Architecture can be easily deployed, and hence it is mostly

used in small projects.

JT 22-07-2024 46
2-TIER ARCHITECTURE
▪ The 2-tier architecture is like a basic client-server model.

▪ The application at the client end directly communicates with the database on the server side.

▪ APIs like ODBC and JDBC are used for this interaction.

▪ The server side is responsible for providing query processing and transaction management

functionalities.

▪ On the client side, the user interfaces and application programs are run. The application on

the client side establishes a connection with the server side to communicate with the DBMS.

▪ An advantage of this type is that maintenance and understanding are easier, and compatible

with existing systems. However, this model gives poor performance when there are many
users.
JT 22-07-2024 47
ADVANTAGES OF 2-TIER ARCHITECTURE
▪ Easy to Access: 2-Tier Architecture makes easy access to the database, which
makes fast retrieval.

▪ Scalable: We can scale the database easily, by adding clients or upgrading


hardware.

▪ Low Cost: 2-Tier Architecture is cheaper than 3-Tier Architecture and Multi-Tier
Architecture.

▪ Easy Deployment: 2-Tier Architecture is easier to deploy than 3-Tier


Architecture.

▪ Simple: 2-Tier Architecture is easily understandable as well as simple because


of only two components.
JT 22-07-2024 48
3-TIER ARCHITECTURE
▪ In 3-Tier Architecture, there is another layer between the

client and the server.

▪ The client does not directly communicate with the server.

▪ Instead, it interacts with an application server which further

communicates with the database system and then the query


processing and transaction management takes place.

▪ This intermediate layer acts as a medium for the exchange of

partially processed data between the server and the client.

▪ This type of architecture is used in the case of large web

applications.
49 JT 22-07-2024
ADVANTAGES OF 3-TIER ARCHITECTURE
▪ Enhanced scalability: Scalability is enhanced due to the distributed deployment of

application servers. Now, individual connections need not be made between the client
and server.

▪ Data Integrity: 3-Tier Architecture maintains Data Integrity. Since there is a middle

layer between the client and the server, data corruption can be avoided/removed.

▪ Security: 3-Tier Architecture Improves Security. This type of model prevents direct

interaction of the client with the server thereby reducing access to unauthorized data.

JT 22-07-2024 50
DISADVANTAGES OF 3-TIER ARCHITECTURE
▪ More Complex: 3-Tier Architecture is more complex in comparison to 2-Tier

Architecture. Communication Points are also doubled in 3-Tier Architecture.

▪ Difficult to Interact: It becomes difficult for this sort of interaction to take place due

to the presence of middle layers.

JT 22-07-2024 51
DATABASE LIFECYCLE

JT 22-07-2024 52
DATABASE LIFECYCLE-LOGICAL DESIGN

JT 22-07-2024 53
SAMPLE ER DIAGRAM

JT 22-07-2024 54
DATABASE LIFE CYCLE-PHYSICAL DESIGN
▪ Table Name: Retail Outlet

JT 22-07-2024 55
DATABASE LIFE CYCLE-IMPLEMENTATION

JT 22-07-2024 56
57
DATA MODELS, SCHEMAS,
AND INSTANCES

JT 22-07-2024
DATA MODELS
▪ Data modeling is the process of creating a visual representation of either a whole
information system or parts of it to communicate connections between data points and
structures.

▪ The goal is to illustrate the types of data used and stored within the system, the
relationships among these data types, the ways the data can be grouped and organized
and its formats and attributes.

▪ Data modeling employs standardized schemas and formal techniques.

▪ This provides a common, consistent, and predictable way of defining and managing
data resources across an organization, or even beyond.

JT 22-07-2024 58
DATA MODELS
▪ Data Model is the modeling of the data description, data semantics, and consistency

constraints of the data.

▪ It provides the conceptual tools for describing the design of a database at each level of

data abstraction.

▪ Therefore, there are following four data models used for understanding the structure of

the database:

JT 22-07-2024 59
TYPES OF DATA MODELS

JT 22-07-2024 60
1) RELATIONAL DATA MODEL:
▪ This type of model designs the data in the form of rows and columns within a table.

▪ Thus, a relational model uses tables for representing data and in-between relationships.
Tables are also called relations.

▪ This model was initially described by Edgar F. Codd, in 1969.

▪ The relational data model is the widely used model which is primarily used by
commercial data processing applications.

▪ It is so named because the database is structured in fixed-format records of several


types.

JT 22-07-2024 61
2) ENTITY-RELATIONSHIP DATA MODEL:
▪ An ER model is the logical representation of data as objects and relationships among them.

▪ These objects are known as entities, and relationship is an association among these

entities.

▪ This model was designed by Peter Chen and published in 1976 papers.

▪ It was widely used in database designing. A set of attributes describe the entities.

▪ For example, student_name, student_id describes the 'student' entity. A set of the same

type of entities is known as an 'Entity set', and the set of the same type of relationships is
known as 'relationship set'.
JT 22-07-2024 62
3) OBJECT-BASED DATA MODEL:
▪ An extension of the ER model with notions of functions, encapsulation, and object

identity, as well.

▪ This model supports a rich type system that includes structured and collection types.

▪ Thus, in 1980s, various database systems following the object-oriented approach were

developed.

▪ Here, the objects are nothing but the data carrying its properties.

▪ It combines the features of object-oriented data model and relational data models.

JT 22-07-2024 63
4) SEMI-STRUCTURED DATA MODEL:
▪ This type of data model is different from the other three data models (explained

above).

▪ The semi-structured data model allows the data specifications at places where the

individual data items of the same type may have different attributes sets.

▪ The Extensible Markup Language, also known as XML, is widely used for representing

the semi-structured data.

▪ Although XML was initially designed for including the markup information to the text

document, it gains importance because of its application in the exchange of data.


JT 22-07-2024 64
BENEFITS OF DATA MODELING
▪ Reduce errors in software and database development.

▪ Increase consistency in documentation and system design across the enterprise.

▪ Improve application and database performance.

▪ Ease data mapping throughout the organization.

▪ Improve communication between developers and business intelligence teams.

▪ Ease and speed the process of database design at the conceptual, logical and
physical levels.

JT 22-07-2024 65
DATA MODELLING TOOLS

JT 22-07-2024 66
DATA MODELLING TOOLS
▪ Erwin Data Modeler is a data modeling tool based on the Integration DEFinition for
information modeling (IDEF1X) data modeling language that now supports other notation
methodologies, including a dimensional approach.

▪ Enterprise Architect is a visual modeling and design tool that supports the modeling of
enterprise information systems and architectures as well as software applications and databases.
It’s based on object-oriented languages and standards.

▪ ER/Studio is database design software that’s compatible with several of today’s most popular
database management systems. It supports both relational and dimensional data modeling.

▪ Free data modeling tools include open source solutions such as Open ModelSphere.

JT 22-07-2024 67
DATABASE SCHEMA
▪ A database schema is the skeleton structure that represents the logical view of the entire
database.

▪ It defines how the data is organized and how the relations among them are associated.

▪ It formulates all the constraints that are to be applied on the data.

▪ A database schema defines its entities and the relationship among them.

▪ It contains a descriptive detail of the database, which can be depicted by means of schema
diagrams.

▪ It’s the database designers who design the schema to help programmers understand the
database and make it useful.

JT 22-07-2024 68
DATABASE SCHEMA

JT 22-07-2024 69
DATABASE SCHEMA
▪ A database schema can be divided broadly into two categories −
▪ Physical Database Schema −

▪ This schema pertains to the actual storage of data and its form of storage like
files, indices, etc.
▪ It defines how the data will be stored in a secondary storage.

▪ Logical Database Schema −

▪ This schema defines all the logical constraints that need to be applied on the
data stored.
▪ It defines tables, views, and integrity constraints.

JT 22-07-2024 70
DATABASE INSTANCES
▪ A database instance is a state of operational database with data at any given

time.

▪ It contains a snapshot of the database.

▪ Database instances tend to change with time.

▪ A DBMS ensures that its every instance (state) is in a valid state, by diligently

following all the validations, constraints, and conditions that the database
designers have imposed.

JT 22-07-2024 71
DATA INDEPENDENCE
▪ A database system normally contains a lot of data in addition to users’ data.
▪ For example, it stores data about data, known as metadata, to locate and
retrieve data easily.
▪ It is rather difficult to modify or update a set of metadata once it is stored in the
database.
▪ But as a DBMS expands, it needs to change over time to satisfy the
requirements of the users.
▪ If the entire data is dependent, it would become a tedious and highly complex
job.

JT 22-07-2024 72
DATA INDEPENDENCE

JT 22-07-2024 73
LOGICAL DATA INDEPENDENCE
▪ Logical data is data about database, that is, it stores information about how data
is managed inside.
▪ For example, a table (relation) stored in the database and all its constraints,
applied on that relation.
▪ Logical data independence is a kind of mechanism, which liberalizes itself from
actual data stored on the disk.
▪ If we do some changes on table format, it should not change the data residing
on the disk.

JT 22-07-2024 74
PHYSICAL DATA INDEPENDENCE
▪ All the schemas are logical, and the actual data is stored in bit format on the

disk.

▪ Physical data independence is the power to change the physical data without

impacting the schema or logical data.

▪ For example, in case we want to change or upgrade the storage system itself −

suppose we want to replace hard-disks with SSD − it should not have any
impact on the logical data or schemas.

JT 22-07-2024 75

You might also like