0% found this document useful (0 votes)
14 views98 pages

Introduction To DBMS

The document outlines the importance of studying Database Management Systems (DBMS), highlighting its relevance across various industries such as finance, telecommunications, and education. It details the course structure, evaluation methodology, and learning outcomes, emphasizing skills in database design, SQL application, and data integrity. Additionally, it discusses the limitations of traditional file-oriented data storage and the advantages of using a DBMS for efficient data management and security.
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)
14 views98 pages

Introduction To DBMS

The document outlines the importance of studying Database Management Systems (DBMS), highlighting its relevance across various industries such as finance, telecommunications, and education. It details the course structure, evaluation methodology, and learning outcomes, emphasizing skills in database design, SQL application, and data integrity. Additionally, it discusses the limitations of traditional file-oriented data storage and the advantages of using a DBMS for efficient data management and security.
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/ 98

KCS501 - DBMS

1
Course Code: KCS 501 Data Base Management System L T P C
3 0 2 4
Why to Study Data Base Management System
Almost every software application relies on a database to store, retrieve, and manage data. This subject directly
contributes to students' employability by imparting skills that are in high demand across industries. A DBMS
allows organizations to enforce data security and privacy policies to reduce the risk of a data breach. Here are
some DBMS use cases in different industries: Economics and finance firms store information about customer
transactions, stock market trades, bonds, mortgages, and other financial products. Here are the following areas
where it is highly demanding.
 Telecommunications companies store information about customer calls, billing, archives, and plan features
and capabilities.
 Airlines store information about flight schedules, employee work histories, safety records, reservations, and
maintenance.
 Educational institutions store information about class schedules, student records, teacher reviews and
remuneration, and class registration.
 Sales and marketing organizations store information about customer meetings and sales, returns, feedback,
and prospects.
 Human resources firms store information about new and prospective hires, payroll, taxes, employee
performance reviews, and more.
 Manufacturers store information about inventory, operations, production blueprints, supply chain, and
maintenance.

2
Evaluation Methodology (Internal Total Marks:50, CTs: 30, TA: 15, Att.: 05)
Evaluation Category (A) :[15 Marks] Evaluation Category (C): [15 Marks]
 Two Analytical and applied based  Minimum two Coursera/ Udemy /LinkedIn/other
Assignments [ 5 Marks] course certificates as prescribed by subject teachers
[ 5 * 2 Marks = 10 Marks]

 One video Assignment [ 5 Marks]  Two Quizzes-2[ 2.5x2=5 Marks]

 Two Quizzes [ 2.5 x2 =5 Marks]

Note: One quiz is near to Mid Sem Exam and


the Second is near to End Sem Exam

3
MOOC Courses
1. https://www.udemy.com/course/relational-database-management-systemrdbms-complete-pack/
2. https://www.udemy.com/course/simplified-approach-to-dbms/
3. https://www.udemy.com/course/database-and-sql-for-beginners/
4. https://www.udemy.com/course/sql-made-easy-for-beginners/
5. https://www.udemy.com/course/learn-sql-beginner-to-advance-level/
6. https://www.udemy.com/course/database-design-from-a-z-with-real-project-arabic-course/
7. https://www.udemy.com/course/learn-complete-database-design-with-mysql-database-project/
8. https://learn.365datascience.com/courses/sql/welcome-to-sql/
9. https://www.linkedin.com/learning/database-foundations-intro-to-databases/an-introduction-to-database-foundati
ons?u=236312842

10. https://www.linkedin.com/learning/paths/become-a-database-administrator?u=236312842 4
5
Bloom’s Knowledge
Course Outcome (CO) Knowledge Level Category
(KL) (KC)

Attendees of the course will be able to:


Acquire knowledge of database design
CO 1 methodology for real-life applications. 2 Conceptual

Apply the concept of an ER diagram to design an Conceptual,


CO 2 information model. 3 Procedural
Conceptual,
CO 3 Apply the concept of SQL to real-life databases. 3 Procedural
Analyze the redundancy problem in the database 4 Conceptual,
CO 4 and reduce it using normalization. Procedural
Identify the broad range of database
4 Conceptual,
CO 5 management issues including integrity, security, Procedural
and recovery transactions.

6
Introduction to DBMS

7
Traditional Method of Data Storage

8
• In the traditional approach, we used to store information in flat files
which are maintained by the file system under the operating system’s
control.
• Application programs go through the file system to access these flat
files

9
Ways of storing data in files –
customer data

10
File System Cont.
• Data used to be stored in the form of records in the files.
• Records consist of various fields which are delimited by a space ,
comma , tab etc.
• There used to be special characters to mark end of records and
end of files.

11
1. Master file
The file that is created only once i.e. at the starting of computerization
or a file which rarely changes. For example: In a bank master file the
account no, name and balance are entered only once and less
frequently changes.
2. File activity ratio
The number of records processed one run divided by total number of
records. For example: if we changes 100 records from a bank file
containing 200 records then file activity ratio is 100/200 0.5. It should
be noted that this ratio of master file is less.
3. Transaction file
A file that is created repeatedly after regular interval of time. For
example: the payroll file of employee is updated at the end of every
month. 12
4. Work file
A temporary file that helps in sorting and merging of records from one
file to other.

13
LIMITATIONS OF FILE ORIENTED
APPROACH
1. Duplicate data / Data Redundancy
Since all the files are independent of each other. So some of the fields
or files are stored more than once. Hence duplicacy is more in case of
file approach. This duplication of data (redundancy) leads to higher
storage and access cost. In addition it may lead to data inconsistency

14
2. Data Inconsistency
In this system, data is not consistent. If a data item is changed then all the
files containing that data item need to be changed and updated properly. If all
the files are not updated properly there may be high risk of inconsistency.
For Example, assume the same data is repeated in two or more files. If
change is made to data in one file, it is required that the change be made to
the data in the other file as well. If this is not done, it will lead to error during
access to the data.

• Example: Assume Customer’s details such as Cust_Last_Name,


Cust_Mid_Name
Cust_First_Name, Cust_Email is stored both in the Customer_Details file and
the Customer_Fixed_Deposit file. If the Email ID of one Customer, for example,
Langer S. Justin changes from [email protected] to
[email protected], the Cust_Email has to be updated in both the
files; otherwise it will lead to inconsistent data. 15
3. Separated and isolated data
To make a decision, a user might need data from two separate files.
First, analysts and programmers to determine the specific data
required from each file and the relationships between the data
evaluated the files. Then applications could be written in a third
generation language to process and extract the needed data.
Imagine the work involved if data from several files was needed!

16
4. Poor data security
All the files are stored in the flat form or text files. These files can
be easily located and trapped because file approach, has no data
security.
The data as maintained in the flat file(s) is easily accessible and
therefore not secure

17
5. Program / Data Dependence
Users and application programs need to know exactly where or how
the data is stored in order to access it. In file processing system the
physical formats of the files are entered in the programs. The
change in file means change in program and vice versa.

6. Every operation is programmable


The processing tasks like searching, editing, deletion etc should
have separate programs. It means there were no functions available
for these operations. DBMS have ready-made commands for such
operations.

18
7. Concurrency problem
It means using a same record at same time by more than one user
at the same time. This problem was common in file approach but
can be controlled in DBMS.

19
Basic Definitions - DBMS
• Data ?

20
Basic Definitions
• Data: Known facts that can be recorded and have an implicit meaning.

21
Basic Definitions
• Data: Known facts that can be recorded and have an implicit meaning.
• DataBase?

22
Basic Definitions
• Data: Known facts that can be recorded and have an implicit meaning.
• DataBase: A collection of related data. (Databases are used for storing,
maintaining and accessing any sort of data. They collect information on
people, places or things. That information is gathered in one place so
that it can be observed and analyzed.)

23
Basic Definitions
• Data: Known facts that can be recorded and have an implicit meaning.
• DataBase: A collection of related data. (Databases are used for storing,
maintaining and accessing any sort of data. They collect information on
people, places or things. That information is gathered in one place so
that it can be observed and analyzed.)
• DataBase Management System(DBMS)?

24
Basic Definitions
• Data: Known facts that can be recorded and have an implicit meaning.
• DataBase: A collection of related data. (Databases are used for storing,
maintaining and accessing any sort of data. They collect information on
people, places or things. That information is gathered in one place so
that it can be observed and analyzed.)
• DataBase Management System(DBMS): A software package/ system
to facilitate the creation and maintenance of a computerized database.

25
Basic Definitions
• Data: Known facts that can be recorded and have an implicit meaning.
• DataBase: A collection of related data. (Databases are used for storing,
maintaining and accessing any sort of data. They collect information on
people, places or things. That information is gathered in one place so
that it can be observed and analyzed.)
• DataBase Management System(DBMS): A software package/ system
to facilitate the creation and maintenance of a computerized database.
• DataBase System?

26
Basic Definitions
• Data: Known facts that can be recorded and have an implicit meaning.
• DataBase: A collection of related data. (Databases are used for storing,
maintaining and accessing any sort of data. They collect information on
people, places or things. That information is gathered in one place so
that it can be observed and analyzed.)
• DataBase Management System(DBMS): A software package/ system
to facilitate the creation and maintenance of a computerized database.
• DataBase System: The DBMS software together with the data itself.
Sometimes, the applications are also included.

27
Database Systems
• DBMS contains information about a particular enterprise
• Collection of interrelated data
• Set of programs to access the data
• An environment that is both convenient and efficient to use
• Database systems are used to manage collections of data that are:
• Highly valuable
• Relatively large
• Accessed by multiple users and applications, often at the same time.
• A modern database system is a complex software system whose task is to manage a large,
complex collection of data.
• Databases touch all aspects of our lives

28
Database Applications Examples
• Enterprise Information
• Sales: customers, products, purchases
• Accounting: payments, receipts, assets
• Human Resources: Information about employees, salaries, payroll taxes.
• Manufacturing: management of production, inventory, orders, supply chain.
• Banking and finance
• customer information, accounts, loans, and banking transactions.
• Credit card transactions
• Finance: sales and purchases of financial instruments (e.g., stocks and bonds; storing real-
time market data
• Universities: registration, grades

29
Database Applications Examples
(Cont.)
• Airlines: reservations, schedules
• Telecommunication: records of calls, texts, and data usage, generating monthly bills, maintaining
balances on prepaid calling cards
• Web-based services
• Online retailers: order tracking, customized recommendations
• Online advertisements
• Document databases
• Navigation systems: For maintaining the locations of varies places of interest along with the exact
routes of roads, train systems, buses, etc.

30
Purpose of Database Systems
In the early days, database applications were built directly on top of file systems, which leads to:

• Data redundancy and inconsistency: data is stored in multiple file formats resulting in 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

31
Purpose of Database Systems
(Cont.)
• Atomicity problems
• 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 anomalies
• Concurrent access needed for performance
• Uncontrolled concurrent accesses can lead to inconsistencies
• Ex: 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


32
Typical DBMS Functionality
• Define a database : in terms of data types, structures and
constraints
• Construct or Load the Database on a secondary storage medium
• Manipulating the database : querying, generating reports,
insertions, deletions and modifications to its content
• Concurrent Processing and Sharing by a set of users and programs –
yet, keeping all data valid and consistent

33
Typical DBMS Functionality

Other features:
• Protection or Security measures to prevent unauthorized access
• “Active” processing to take internal actions on data
• Presentation and Visualization of data

34
Where does the DBMS fit in?

Now, the DBMS acts as a layer of abstraction on top of the File system.
• You might have observed that, for interacting with the file system, we were using
high level language functions for example, the ‘c’ file handling functions. For
interacting with the DBMS we would be using a Query language called SQL 35
Difference Between File and DBMS Operations

36
Types of Database

37
38
Main Characteristic of Database
• Data Abstraction
• Support of multiple views of the data
• Self-describing nature of a database system
• Insulation between programs and data
• Sharing of data and multiuser transaction processing

39
Main Characteristic of Database
• Data Abstraction: A data model is used to hide storage details and
present the users with a conceptual view of the database.
• Support of multiple views of the data
• Self-describing nature of a database system
• Insulation between programs and data
• Sharing of data and multiuser transaction processing

40
Main Characteristic of Database
• Data Abstraction: A data model is used to hide storage details and
present the users with a conceptual view of the database.
• 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.
• Self-describing nature of a database system
• Insulation between programs and data
• Sharing of data and multiuser transaction processing

41
Main Characteristic of Database
• Data Abstraction: A data model is used to hide storage details and
present the users with a conceptual view of the database.
• 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.
• Self-describing nature of a database system: A DBMS catalog 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
• Sharing of data and multiuser transaction processing
42
Main Characteristic of Database
• Data Abstraction: A data model is used to hide storage details and present
the users with a conceptual view of the database.
• 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.
• Self-describing nature of a database system: A DBMS catalog 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.
• Sharing of data and multiuser transaction processing
43
Main Characteristic of Database
• Data Abstraction: A data model is used to hide storage details and present the users with a
conceptual view of the database.
• 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.
• Self-describing nature of a database system: A DBMS catalog 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.
• Sharing of data and multiuser 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. OLTP (Online Transaction
Processing) is a major part of database applications.
44
Three Level Architecture of
DBMS
A major purpose of a database system is to provide users with an abstract view
of the data. That is, the system hides certain details of how the data is stored and
maintained.

• External or View Level

• Conceptual Level

• Internal or Physical Level

45
46
Three Level Architecture of DBMS
Sales Officer Inventory Controller
View 1 View 2 continue…
Item_Name Item_Name
External Price Stock
Level
Conceptual
Item_Number Character (6)
Item_Name Character(30)
Conceptual Price Numeric(5,2)
Level Stock Numeric(4)

Physical
Stored_Item Length=50
Physical Item # Type = Byte(6), offset = 0, Index = Ix
Level Name Type = Byte(30), offset = 6
Price Type = Byte(8), offset = 36
Stock Type = Byte(4), offset = 44
47
External or View Level

This level is closest to the users and is concerned with the way in
which the data is viewed by individual users. Most of the users are
not concerned with all the information contained in the database.
Instead they need only a part of the database relevant to them.
The system provides many views for the same database.

48
External or View Level
continue…

• Highest level of abstraction of database.

• Allows to see only the data of interest to them.

• Users – Application programmers or end-users.

• Any no. of external views – external schema.

49
Conceptual Level

This level of abstraction describes what data are actually stored in the
database. It also describes the relationships existing among data. At
this level, the database is described logically in terms of simple data-
structures. The users of this level are not concerned with how these
logical data structures will be implemented at the physical level, rather
they just are concerned about what information is to be kept in the
database.

50
Conceptual Level
continue…

• Describes what data are actually stored in the database (i.e. all the
records and relationships included in the database).

• The conceptual view is a representation of the entire information


content of the database in a form that is some what abstract in
comparison with the way in which the data is physically stored.

51
Internal or Physical Level
• Lowest level of abstraction.

• Describes how the data are physically stored.

• Internal view – internal schema (not only defines the various types of stored
record but also specifies what indexes exists, how files are represented, etc.)

• The internal level is closest to physical storage. This level is also termed as
physical level. It describes how the data are actually stored on the storage
medium. At this level, complex low-level data structures are described in
detail.
52
Data Independence

The ability to modify a schema definition in one level without affecting a


schema definition in the next higher level is called DATA INDEPENDENCE

• Physical Data Independence

• Logical Data Independence

53
Physical Data Independence

It refers to the ability to modify the schema at the physical level without
affecting the schema followed at the conceptual level.

The application programs remain the same even though the schema at the
physical level gets modified.

Modifications at the physical level are occasionally necessary in order to


improve performance of the system.

54
Logical Data Independence

It refers to the ability to modify the conceptual schema without causing any
changes in the schemas followed at view levels.

The logical data independence ensures that the application programs remain
the same.

Modifications at the conceptual level are necessary whenever logical


structures of the database get altered because of some unavoidable reasons.

55
Physical & Logical Data
Independence

It is more difficult to achieve logical data independence than the


physical data independence.

The reason being that the application programs are heavily dependent
on the logical structure of the database.

56
Physical DBMS Architecture

• Describes the software components used to enter


and process data.

• How these s/w components are related and


interconnected.

57
DBMS Structure
General users AP Sophisticated DBA
users
Application System Database
Programs Calls Schema

Object Code DML Query DDL


Of Program Precompiler Processor Compiler

Database
Manager

File
Manager

Data Files Data Dict.


58
DBMS Structure
General users AP Query DBA

Application System Database


Programs Calls Schema

Object Code DML Query DDL


Of Program Precompiler Processor Compiler

Database
DDL – set of commands required to Manager the
define format of data.
DML – set of commands that modify, process data.
File
DML precompiler converts DML statements embedded in an
Manager
application program to normal procedural calls in the host
language. It interacts with the query processor in order to
generate the appropriate code. Data Files Data Dict.
59
DBMS Structure
General users Query DBA

Application Database
Programs Schema

Object Code DML Query DDL


Of Program Precompiler Processor Compiler

Database
Manager

DDL compiler converts DDL statements into a set of tables


File in a form that can be
containing metadata tables – which are
Manager
used by other components of the DBMS. These are stored in
system catalog or data dictionary.
Data Files Data Dict.
60
DBMS Structure
General users AP Query DBA

Application System Database


Programs Calls Schema

Manages the allocation of space on disk storage.


Object Code DML Query DDL
Of Program Precompiler Processor Compiler

Database
Manager

File
Manager

Data Files Data Dict.


61
DBMS Structure
General users AP Query DBA

Application System Database


Programs Calls Schema

Object Code DML Query DDL


Of Program Precompiler Processor Compiler

Database
Manager

Responsible for receiving query language File statements and


Manager
changing to a form the DBMS can understand. It has
two parts : (i) parser (ii) query optimizer
Data Files Data Dict.
62
DBMS Structure
General users AP Query DBA

Application System Database


Programs Calls Schema
It is the interface b/w low-
level data, application
programs and queries.
Object Code DML It Query DDL
Of Program constraints
enforces Precompiler to Processor Compiler
maintain the consistency and
integrity of the data as well as Database
Manager
its security. It synchronizes the
concurrent access. It also
File
perform backup and recovery Manager
operations.

Data Files Data Dict.


63
DBMS Structure
General users AP Query DBA

Components System
Application Database
Programs Calls Schema
• Authorization Control
• Command Processor
Object Code DML Query DDL
• Integrity Checker
Of Program Precompiler Processor Compiler
• Query Optimizer
• Transaction Manager Database
• Scheduler Manager
• Recovery Manager
• Buffer Manager File
Manager

Data Files Data Dict.


64
DBMS Structure
General users AP Query DBA

Components System
Application Database
Programs Calls Schema
• Authorization Control
• Command Processor
Object Code DML Query DDL
• Integrity Checker
Of Program Precompiler Processor Compiler
• Query Optimizer
• Transaction Manager Database
• Scheduler Manager
• Recovery Manager
• Buffer Manager File
Checks that the user has necessary authorization to carry
Manager
out the required function.

Data Files Data Dict.


65
DBMS Structure
General users AP Query DBA

Components System
Application Database
Programs Calls Schema
• Authorization Control
• Command Processor
Object Code DML Query DDL
• Integrity Checker
Of Program Precompiler Processor Compiler
• Query Optimizer
• Transaction Manager Database
• Scheduler Manager
• Recovery Manager
• Buffer Manager File
Manager
Converts commands to a logical sequence of steps.

Data Files Data Dict.


66
DBMS Structure
General users AP Query DBA

Components System
Application Database
Programs Calls Schema
• Authorization Control
• Command Processor
Object Code DML Query DDL
• Integrity Checker
Of Program Precompiler Processor Compiler
• Query Optimizer
• Transaction Manager Database
• Scheduler Manager
• Recovery Manager
• Buffer Manager File
Checks the requested operation satisfies all necessary
Manager
integrity constraints such as key constraints.

Data Files Data Dict.


67
DBMS Structure
General users AP Query DBA

Components
Application System Database
Programs Calls Schema
• Authorization Control
• Command Processor
Object Code DML Query DDL
• Integrity Checker
Of Program Precompiler Processor Compiler
• Query Optimizer
• Transaction Manager Database
• Scheduler Manager
• Recovery Manager
• Examines the query language statements and tries to
Buffer Manager File
choose the best and most efficient way to executing the
Manager
query. Factors – CPU time, disk time, network time,
sorting methods and scanning methods.
Data Files Data Dict.
68
DBMS Structure
General users AP Query DBA

Components System
Application Database
Programs Calls Schema
• Authorization Control
• Command Processor
Object Code DML Query DDL
• Integrity Checker
Of Program Precompiler Processor Compiler
• Query Optimizer
• Transaction Manager Database
• Scheduler Manager
• Recovery Manager
• Buffer Manager File
Manager
The transaction manager maintains tables of
authorization concurrency.
Data Files Data Dict.
69
DBMS Structure
General users AP Query DBA

Components System
Application Database
Programs Calls Schema
• Authorization Control
• Command Processor
Object Code DML Query DDL
• Integrity Checker
Of Program Precompiler Processor Compiler
• Query Optimizer
• Transaction Manager Database
• Scheduler Manager
• Recovery Manager
• Buffer Manager File
Manager
It controls the relative order in which transaction
operations are executed.
Data Files Data Dict.
70
DBMS Structure
General users AP Query DBA

Components System
Application Database
Programs Calls Schema
• Authorization Control
• Command Processor
Object Code DML Query DDL
• Integrity Checker
Of Program Precompiler Processor Compiler
• Query Optimizer
• Transaction Manager Database
• Scheduler Manager
• Recovery Manager
• Buffer Manager File
Manager
Ensures that the database remains in a consistent state in
the presence of failures. Responsible for transaction
commit and abort.
Data Files Data Dict.
71
DBMS Structure
General users AP Query DBA

Components System
Application Database
Programs Calls Schema
• Authorization Control
• Command Processor
Object Code DML Query DDL
• Integrity Checker
Of Program Precompiler Processor Compiler
• Query Optimizer
• Responsible for the transfer of data between main
Transaction Manager
• memory and secondary storage. Database
Scheduler Manager
• Recovery Manager
• Buffer Manager File
Manager

Data Files Data Dict.


72
Database System Utilities
Apart from software modules most DBMS have database utilities that
help the DBA manage the database system. Common utilities have
the following types of functions.
• Loading
• Backup
• Database storage reorganization
• Performance monitoring

73
Database Users

1. Database Administrators – The DBA is responsible for authorizing


access to the database, coordinating and monitoring its use, and
acquiring software and hardware resources as needed. The DBA is
accountable for problems such as breach of security or poor system
response time.
Database Users

2. Database Designers – Responsible for


• Identifying the data to be stored in the database.
• Choosing the appropriate structure to represent and store this data.
• Communicating with all prospective database users in order to understand
their requirements and to create a design that meets these requirements.
Database Users

3. End Users – Are the people who uses the database for
querying, updating, and generating reports. Different
categories of end users are –
• Casual End Users – Occasionally access the database, but they
may need different information each time.
• Naïve or Parametric End User - Their main job function revolves
around constantly querying and updating the database, using
standard types of queries and updates – called canned
transactions. Ex – Bank tellers check account balances and post
withdrawals and deposits. Reservation clerk checks for
availability and make reservations.
• Sophisticated End Users - Includes scientists, engineers who
thoroughly familiarize themselves with the facilities of DBMS in
order to implement their applications to meet their complex
requirements.
• Standalone Users – Maintain personal database by using ready
made program packages that provide easy to use menu based or
graphics based interfaces.
Database Users

4. System Analyst and Application Programmers:


System analyst determine the requirements of end
users and application programmers implement these
specifications as programs.
Advantages of Using the DBMS Approach

1. Controlling Redundancy – In the database approach, the views of


different groups are integrated during database design. Ideally, we
should have a database design that stores each logical data item –
such as student name, or birth date in only one place in the database.
This ensures consistency and saves storage space.
Advantages of Using the DBMS Approach

2. Restricting Unauthorized Access – The DBA can grant/revoke


authorization access to specific user. This improves security. So only
authorized users can only able to access the database.
3. Providing Storage Structure for Efficient Query Processing
Advantages of Using the
Database Approach
• Providing backup and recovery services.
• Providing multiple interfaces to different classes of
users.
• Representing complex relationships among data.
• Enforcing integrity constraints on the database.

Slide 1-80
Additional Implications of Using the
Database Approach
• Potential for enforcing standards: this is very
crucial for the success of database applications
in large organizations Standards refer to data
item names, display formats, screens, report
structures, meta-data (description of data) etc.
• Reduced application development time:
incremental time to add each new application
is reduced in comparison of file system.

Slide 1-81
Additional Implications of Using the
Database Approach
• Flexibility to change data structures:
database structure may evolve as new
requirements are defined.
• Availability of up-to-date information – very
important for on-line transaction systems
such as airline, hotel, car reservations.
• Economies of scale: by consolidating data
and applications across departments wasteful
overlap of resources and personnel can be
avoided.
Slide 1-82
When not to use a DBMS
• Main inhibitors (costs) of using a DBMS:
• High initial investment and possible need for
additional hardware.
• Overhead for providing generality, security,
concurrency control, recovery, and integrity functions.
• When a DBMS may be unnecessary:
• If the database and applications are simple, well
defined, and not expected to change.
• If there are stringent real-time requirements that may
not be met because of DBMS overhead.
• If access to data by multiple users is not required.

Slide 1-83
When not to use a DBMS
• When no DBMS may suffice:
• If the database system is not able to handle the complexity of data because of
modeling limitations
• If the database users need special operations not supported by the DBMS.

Slide 1-84
Data Models
• Data Model: A collection of tools for describing
• Data
• Data relationships
• Data semantics
• Data constraints
Categories of Data Models
• Conceptual (high-level, semantic) data models: Provide concepts that are close
to the way many users perceive data. (Also called entity-based or object-based
data models.)

• Physical (low-level, internal) data models: Provide concepts that describe details
of how data is stored in the computer.

• Implementation (representational) data models: Provide concepts that fall


between the above two, balancing user views with some computer storage
details. (Relational data model)
Definitions
• Database Schema: The description of a database. Includes
descriptions of the database structure and the constraints
that should hold on the database.
• Database Instance: The actual data stored in a database at a
particular moment in time. Also called database state (or
occurrence).
• Database State: Refers to the content of a database at a
moment in time.
• Initial Database State: Refers to the database when it is
loaded
• Valid State: A state that satisfies the structure and
constraints of the database.
Simplified Database System Environment
SQL Query Language
• SQL query language is nonprocedural. A query takes as input several tables
(possibly only one) and always returns a single table.
• Example to find all instructors in Comp. Sci. dept
select name
from instructor
where dept_name = 'Comp. Sci.'
• To be able to compute complex functions SQL is usually embedded in some
higher-level language
• Application programs generally access databases through one of
• Language extensions to allow embedded SQL
• Application program interface (e.g., ODBC/JDBC) which allow SQL queries
to be sent to a database
Data Definition Language
The SQL data-definition language (DDL) allows the specification of information
about relations, including:

• The schema for each relation.


• The domain of values associated with each attribute.
• Integrity constraints
• And as we will see later, also other information such as
• The set of indices to be maintained for each relations.
• Security and authorization information for each relation.
• The physical storage structure of each relation on disk.
Data Definition Language (DDL)
• Specification notation for defining the database schema
Example:create table instructor (
ID char(5),
name varchar(20),
dept_name varchar(20),
salary numeric(8,2))
• DDL compiler generates a set of table templates stored in a data dictionary
• Data dictionary contains metadata (i.e., data about data)
• Database schema
• Integrity constraints
• Primary key (ID uniquely identifies instructors)
• Authorization
• Who can access what
Data Manipulation Language
(DML)
• Language for accessing and updating the data organized by the
appropriate data model
• DML also known as query language
• There are basically two types of data-manipulation language
• Procedural DML -- require a user to specify what data are needed and how to
get those data.
• Declarative DML -- require a user to specify what data are needed without
specifying how to get those data.
• Declarative DMLs are usually easier to learn and use than are procedural
DMLs.
• Declarative DMLs are also referred to as non-procedural DMLs
• The portion of a DML that involves information retrieval is called a
query language.
Thank You

98

You might also like