Topic 1: Database System Concept · DBMS: A database-management system is a collection of...

14
Mr. Satish Pise 1 Topic 1: Database System Concept Define Database. List any two properties of database. Definition: Database is defined as collection of related data. Properties of database are: i) Self-describing nature of a database system ii) Insulation between programs and data iii)Support of multiple views of the data iv) Sharing of data and multi-user transaction processing v) Controlling Redundancy. List any four DBMS software 1. Oracle, 2. MySQL, 3. Microsoft Access, 4. Microsoft SQL Server, 5. IBM DB2 Define DBMS. List any two applications of DBMS. DBMS: A database-management system is a collection of interrelated data and a set of programs to access those data. Applications of DBMS: 1. Banking 2. Airlines and railways 3. Sales 4. Telecommunications 5. Universities. 6. Manufacturing 7. E-commerce 8. Credit card transactions. List any four advantages of DBMS. List and explain any four functions of Database Administrator. List any four advantages of DBMS. System. Following are the advantages of distributed databases over centralized databases.

Transcript of Topic 1: Database System Concept · DBMS: A database-management system is a collection of...

Page 1: Topic 1: Database System Concept · DBMS: A database-management system is a collection of interrelated data and a set of programs to access those data. Applications of DBMS: 1. Banking

Mr. Satish Pise

1

Topic 1: Database System Concept

Define Database. List any two properties of database.

Definition: Database is defined as collection of related data.

Properties of database are:

i) Self-describing nature of a database system

ii) Insulation between programs and data

iii)Support of multiple views of the data

iv) Sharing of data and multi-user transaction processing

v) Controlling Redundancy.

List any four DBMS software

1. Oracle,

2. MySQL,

3. Microsoft Access,

4. Microsoft SQL Server,

5. IBM DB2

Define DBMS. List any two applications of DBMS.

DBMS: A database-management system is a collection of interrelated data and a set of

programs to access those data.

Applications of DBMS:

1. Banking

2. Airlines and railways

3. Sales

4. Telecommunications

5. Universities.

6. Manufacturing

7. E-commerce

8. Credit card transactions.

List any four advantages of DBMS.

List and explain any four functions of Database Administrator.

List any four advantages of DBMS.

System.

Following are the advantages of distributed databases over

centralized databases.

Page 2: Topic 1: Database System Concept · DBMS: A database-management system is a collection of interrelated data and a set of programs to access those data. Applications of DBMS: 1. Banking

Mr. Satish Pise

2

1.Modular Development − If the system needs to be expanded to new locations or new units, in

centralized database systems, the action requires substantial efforts and disruption in the existing

functioning.

2.More Reliable − In case of database failures, the total system of centralized databases comes

to a halt. However, in distributed systems, when a component fails, the functioning of the system

continues may be at a reduced performance. Hence DDBMS is more reliable.

3.Better Response − If data is distributed in an efficient manner, then user requests can be met

from local data itself, thus providing faster response.

4.Lower Communication Cost − In distributed database systems, if data is located locally

where it is mostly used, then the communication costs for data manipulation can be minimized.

5.Local autonomy:

Since data is distributed, a group of users that commonly share such data can have it placed at

the site where they work, and thus have local control.

6. Expandability:

Expansion can be easily achieved by adding processing and storage power to the existing

network.

7 Schema Definition The Database Administrator creates the database schema by executing DDL statements. Schema

includes the logical structure of database table (Relation) like data types of attributes, length of

attributes, integrity constraints etc.

8 Storage structure and access method definition The DBA creates appropriate storage

structures and access methods by writing a set of definitions which is translated by data storage

and DDL compiler.

9 Schema and physical organization modification DBA writes set of definitions to modify the

database schema or description of physical storage organization.

10 Granting authorization for data access The DBA provides different access rights to the users according to their level. Ordinary users

might have highly restricted access to data, while you go up in the hierarchy to the administrator,

you will get more access rights. Integrity constraints specifications: Integrity constraints are

written by DBA and they are stored in a special file which is accessed by database manager

while updating data.

11 Routine Maintenance some of the routine maintenance activities of a DBA is given below.

(i) Taking backup of database periodically

(ii) Ensuring enough disk space is available all the time.

(iii) Monitoring jobs running on the database.

(iv) Ensure that performance is not degraded by some expensive task submitted by some users.

12. Integrity- constraint specification: Integrity constraints are written by DBA and they are

stored in a special file, which is accessed by database manager, while updating the data.

Explain different applications of DBMS.

Airlines and Railways: Online database for reservation, displaying the schedule information.

Banking: Customer inuiry, accounts, loans, and other transactions.

Education: Course registration, result, and other information.

Telecommunications: Communication network, telephone numbers, record of calls, for

Page 3: Topic 1: Database System Concept · DBMS: A database-management system is a collection of interrelated data and a set of programs to access those data. Applications of DBMS: 1. Banking

Mr. Satish Pise

3

generating monthly bills, etc.

E-commerce: Business activity such as online shopping, booking of holiday package, consulting

a doctor, etc.

Human resources: Organizations use database for storing information about their employees,

salaries, benefits,taxes, and for generating salary checks.

What do you mean by database security?

Database security refers to the collective measures used to protect and secure a database

or database management software from illegitimate use and malicious threats and attacks.

Database security covers and enforces security on all aspects and components of

databases like Data stored in database,Database server,DBMS.

What is DBMS? Explain its functions.

Explain any four functions of DBMS.

“DBMS: A database-management system is a collection of interrelated data and a

set of programs to access those data.”

Database Communication Interfaces: The end-user's requests for database access are

transmitted to DBMS in the form of communication messages.

Authorization / Security Management: The DBMS protects the database against unauthorized

access, either international or accidental. It furnishes mechanism to ensure that only authorized

users an access the database.

Backup and Recovery Management: The DBMS provides mechanisms for backing up data

periodically and recovering from different types of failures. This prevents the loss of data.

Concurrency Control Service: Since DBMSs support sharing of data among multiple users,

they must provide a mechanism for managing concurrent access to the database. DBMSs ensure

that the database kept in consistent state and that integrity of the data is preserved.

Transaction Management: A transaction is a series of database operations, carried out by a

single user or application program, which accesses or changes the contents of the database.

Therefore, a DBMS must provide a mechanism to ensure either that all the updates

corresponding to a given transaction are made or that none of them is made.

Database Access and Application Programming Interfaces: All DBMS provide interface to

enable applications to use DBMS services. They provide data access via Structured Query

Language (SQL). The DBMS query language contains two components: (a) a Data Definition

Language (DDL) and (b) a Data Manipulation Language (DML).

Data integrity and consistency: To provide data integrity and data consistency, the dbms

uses sophisticated algorithms to ensure that multiple user can access the database concurrently

without compromising the integrity of the database.

Explain two disadvantages of file processing system.

Disadvantages of file processing system

1. Data redundancy and inconsistency :

Page 4: Topic 1: Database System Concept · DBMS: A database-management system is a collection of interrelated data and a set of programs to access those data. Applications of DBMS: 1. Banking

Mr. Satish Pise

4

Since the files and application programs are created by different programmers over a long

period, the various files are likely to have different formats and the programs may be written in

several programming languages. So , the same information may be duplicated in several places

(files).That repetition of information is known as redundancy.This redundancy leads to higher

storage and access cost. In addition, it may lead to data inconsistency, that isdifferent copies of

the same data may have different values.

2. Difficulty in accessing data :

The conventional file processing system do not allow to access data in a convenient and efficient

way. As the data was scattered in different files and whenever need arises different application

programs were written by different programmers in different formats.

3. Data isolation

As the data scattered in various files and files may be in different formats, writing new

application programs to retrieve the data is very difficult.

4. Integrity problems

The data values stored in the database must satisfy certain types of consistency constraints.

When new constraints are added, it is difficult to change the programs to enforce them.

5. Atomicity problems

A computer system, like any other mechanical or electrical device, is subject to failure.

If any failure occurs in the system the transaction which are executing should fully get executed

or should not, so that database remains in consistent state.

6. Concurrent-access anomalies

To improve the performance of the system, multiple transactions must get executed concurrently.

Multiple transactions may be updating the same data concurrently. In such case the data may

result in inconsistent state

7. Security problems

Only authorized person should be able to modify the data. Security should be maintained at

different levels which were not possible in file processing system.

Explain Distributed Database with example.

Distributed Database: Distributed database is a collection of multiple interconnected

databases, which are spread physically across various locations that communicate via a

computer network.

A Distributed Database Management System (DDBMS) consists of a single logical

database that is split into a number of fragments. Each fragment is stored on one or more

computers under the control of a separate DBMS, with the computers connected by a

communications network. Each site is capable of independently processing user requests

that require access to local data and is also capable of processing data stored on other

computers in the network.

Example:

Using distributed database technology, a bank may implement their database system on a

number of separate computer systems rather than a single, centralized mainframe. The

computer systems may be located at each local branch office: for example, Mumbai,

Pune, Nagpur. A network linking the computer will enable the branches to communicate

with each other, and DDBMS will enable them to access data stored at another branch

Page 5: Topic 1: Database System Concept · DBMS: A database-management system is a collection of interrelated data and a set of programs to access those data. Applications of DBMS: 1. Banking

Mr. Satish Pise

5

office. Thus a client living in Pune can also check his/her account during the stay in

Mumbai or Nagpur

Describe the advantages of Distributed Database Management

Advantages of Distributed Databases

Modular Development − If the system needs to be expanded to new locations or new units, in

centralized database systems, the action requires substantial efforts and disruption in the existing

functioning. However, in distributed databases, the work simply requires adding new computers

and local data to the new site and finally connecting them to the distributed system, with no

interruption in current functions.

More Reliable − In case of database failures, the total system of centralized databases comes to

a halt. However, in distributed systems, when a component fails, the functioning of the system

continues may be at a reduced performance. Hence DDBMS is more reliable.

Better Response − If data is distributed in an efficient manner, then user requests can be met

from local data itself, thus providing faster response. On the other hand, in centralized systems,

all queries have to pass through the central computer for processing, which increases the

response time.

Lower Communication Cost − In distributed database systems, if data is located locally where

it is mostly used, then the communication costs for data manipulation can be minimized. This is

not feasible in centralized systems.

Page 6: Topic 1: Database System Concept · DBMS: A database-management system is a collection of interrelated data and a set of programs to access those data. Applications of DBMS: 1. Banking

Mr. Satish Pise

6

Explain data warehousing and data mining.

What is data warehousing and data mining?

What is data mining and data ware housing?

Data Warehousing:-

A data warehouse is a repository of information gathered from multiple sources, stored

under a unified schema, at a single site. Once gathered, data are stored for long time,

permitting access to historical data.

Data warehouses provide the user a single consolidated interface to data, making

decision-support queries easier to write.

Moreover, by accessing information for decision support from a data warehouse, the

decision makers ensures that online transaction-processing systems are not affectedby

decision support workload

Data Mining:

Data mining is the exploration and analysis of large quantities of data in order to discover

valid, novel, potentially useful and ultimately understandable patterns in data.

It is known as “Knowledge Discovery in Databases”. When the data is stored in large

quantities in data warehouse, it is necessary to dig the data from the ware house that is

useful and required for further use.

For data mining, different software tools are used to analyze, filter and transfer the data

from the data warehouses.

Feature of data mining:

prediction

identification

classification

optimization

List and explain types of DBMS users.

List and explain types of DBMS users.

List of DBMS user:

a) Naive users

b) Application programmers

c) Sophisticated users

d) Specialized users

e) Database administrator

Explanation:

a) Naive User:

Page 7: Topic 1: Database System Concept · DBMS: A database-management system is a collection of interrelated data and a set of programs to access those data. Applications of DBMS: 1. Banking

Mr. Satish Pise

7

Naïve users are unsophisticated users

They are interact with the system through the application program.

They give data as input through application program or get output data which is

generated by

application program.

Example: Bank cashier.

b) Application programmers:

Application programmers are the users who write the program.

These programmers use programming tools to develop the program.

RAD technology is used to write the program.

c) Sophisticated users:

Sophisticated users interact with the system by making the requests in the form of query

language.

These queries are then submitted to the query processor.

Query processor converts the DML statements into lower level interactions which are

understandable by storage manager.

Some sophisticated users can be analyst.

d) Specialized users:

These users are not traditional.

They write some special application programs which are not regular applications.

Example: such types of applications are CAD, knowledge based and expert system.

e) Database administrator:

Responsible for managing whole database system , create and maintains database.

Manages users who can access the database and manages integrity issue.

Manages performance of system as and when required.

Describe function of database administrator.(DBA)

Function of database administrator

1.Schema Definition

The Database Administrator creates the database schema by executing DDL statements. Schema

includes the logical structure of database table (Relation) like data types of attributes, length of

attributes, integrity constraints etc.

2. Storage structure and access method definition

The DBA creates appropriate storage structures and access methods by writing a set of

definitions which is translated by data storage and DDL compiler.

3. Schema and physical organization modification

DBA writes set of definitions to modify the database schema or description of physical storage

organization.

4. Granting authorization for data access

The DBA provides different access rights to the users according to their level. Ordinary users

might have highly restricted access to data, while you go up in the hierarchy to the administrator,

you will get more access rights. Integrity constraints specifications: Integrity constraints are

Page 8: Topic 1: Database System Concept · DBMS: A database-management system is a collection of interrelated data and a set of programs to access those data. Applications of DBMS: 1. Banking

Mr. Satish Pise

8

written by DBA and they are stored in a special file which is accessed by database manager

while updating data.

5. Routine Maintenance

some of the routine maintenance activities of a DBA is given below.

(i) Taking backup of database periodically

(ii) Ensuring enough disk space is available all the time.

(iii) Monitoring jobs running on the database.

(iv) Ensure that performance is not degraded by some expensive task submitted by some users.

6. Integrity- constraint specification:

Integrity constraints are written by DBA and they are stored in a special file, which is accessed

by database manager, while updating the data.

Compare DBMS and RDBMS (any four points).

Differentiate between DBMS and RDBMS.

Page 9: Topic 1: Database System Concept · DBMS: A database-management system is a collection of interrelated data and a set of programs to access those data. Applications of DBMS: 1. Banking

Mr. Satish Pise

9

Explain three tier architecture.

Explain three tier architecture with diagram

Explain three tier architecture with suitable diagram.

In three tier architecture, the communication taken place from client to application server

and then application server to database system to access the data.

The application server or web server is sometimes called middle layer or intermediate

layer. The middle layer which processes applications and database server processes the

queries.

This type of communication system is used in the large applications or the world web

applications.

On WWW all clients requests for data and server serves it. There are multiple servers

used like fax server, proxy server, mail server etc.

What are data independence? What are its types?

Describe data independence with its type.

Data Independence: It is the ability to modify a schema in one level without affecting schema

in another level.

There are two types of data independence:

1) Logical data independence

2) Physical data independence.

Logical data independence: It is the ability to change conceptual schema without affecting

external schema or application programs.

Page 10: Topic 1: Database System Concept · DBMS: A database-management system is a collection of interrelated data and a set of programs to access those data. Applications of DBMS: 1. Banking

Mr. Satish Pise

10

Physical data independence: It is the ability to change internal schema without affecting

conceptual or external schema.

Explain client-Server architecture.

Explain client-server architecture.

Draw and explain client server architecture.

Client server is a system in which all the data & information is stored on the server & all

application programs are stored on the client.

In this client server relationship, several clients can share the same server.

Computer networking allows some task to be executed on a server system and some tasks

on client system. This leads to development of client server architecture.

The clients are the machines which requests for the service to the server. Server is the

machine which serves to the clients.

There are different types of client/server architecture such as

• Two tier architecture,

• Three tier architecture.

In two tier architecture, client systems directly approach database servers whereas in

three tier architecture, there exists a middle layer which acts as application server to

receive and send requests from client machine to database server and vice versa.

Explain three levels of data abstraction with suitable diagram.

What is data abstraction? What are the levels of abstraction?

What is data abstraction, instances and schema?

Explain three levels of data abstraction with suitable diagram.

Data abstraction is a process in which developer hides the complexity from the user to

simplify the user interaction with the system. There are three levels of abstraction:-

Page 11: Topic 1: Database System Concept · DBMS: A database-management system is a collection of interrelated data and a set of programs to access those data. Applications of DBMS: 1. Banking

Mr. Satish Pise

11

Explanation:

1) Physical Level:

It is lowest level of abstraction.

This level defines lowest complicated data structure of database system.

This level hidden from user.

It defines how the data are stored.

2) Logical Level:

The level next to physical level is called logical level.

This level defines what data stored in the database and what are the relationships among these

data.

Fully decides the structure of the entire database.

3) View Level:

This level is used to show the part of database to user.

There are more complexity in physical as well as logical level so user should not interact with

complicated database.

So different view of database can be created for user to interact with database easily.

Schema: The overall design of the database is known as schema. The database schemas are

partitioned at different level of abstractions.

Instance: The collection of information stored in the databases at a particular moment is called

as an instance.

Page 12: Topic 1: Database System Concept · DBMS: A database-management system is a collection of interrelated data and a set of programs to access those data. Applications of DBMS: 1. Banking

Mr. Satish Pise

12

Draw overall structure of DBMS.

Explain the overall structure of DBMS with suitable diagram.

Draw diagram for overall architecture of DBMS.

Components of DBMS structure are classified in 3 categories as:

2. Query processor :

Embedded DML pre compiler: It converts DML statements embedded in application

program to normal procedural calls in host language.

DML Compiler: It translates DML statements of high level language into low level

Page 13: Topic 1: Database System Concept · DBMS: A database-management system is a collection of interrelated data and a set of programs to access those data. Applications of DBMS: 1. Banking

Mr. Satish Pise

13

instruction that a query evaluation engine understands.

DDL interpreter: It interprets DDL statements and records them in a set of tables

containing metadata.

Query evaluation Engine: It executes low level instructions generated by DML

compiler and DDL interpreter.

2. Storage Manager Components :

Transaction manager: It ensures that the database remains in consistenet state despite of

the system failure and that concurrent transaction execution proceeds without conflicting.

File Manager: It manages the allocation of space on disk storage and data structures

used to represent information stored on disk.

Buffer Manager: It is responsible for fetching data from disk storage into main memory

and deciding what data to cache memory.

3. Disk storage :

Data files: It stores the database.

Data Dictionary: It stores metadata that hold particular values.

Indices: Provide fast access to data items that hold particular values.

Statistical data : It stores statistical information about the data in the database. This information

is used by query processor to select efficient ways to execute query.

Enlist different components of DBMS.

Different components of DBMS are: 1. Query Processor (DDL interpreter, DML compiler, Embedded DML Pre-Compiler, Query

Evaluation Engine)

2. Storage Manager (Authorization and Integrity Manager, Transaction Manager, File Manager,

Buffer Manager)

3. Disk Storage ( Data Files, Data Dictionary, Statistical data, indices)

Describe Relational model with example.

Relational Model: Relational Model represents the database as a collection of tables. A table is

a database object that stores data in form of rows and columns. Each row in the table represents

collection of related data value.

Tuple: In relational model, a row is called as tuple.

Attribute: A column header is called as an attribute.

Degree: The degree of relation is number of attributes of the table.

Domain: All permissible values of attributes is called as a domain.

Cardinality: Number of rows in the table is called as cardinality

e.g. Create table Student_details(RollNo number(3),Name varchar(15)); Student_details:

Roll No Name

11 Nita

12 Rahul

Page 14: Topic 1: Database System Concept · DBMS: A database-management system is a collection of interrelated data and a set of programs to access those data. Applications of DBMS: 1. Banking

Mr. Satish Pise

14

13 Rakesh

In the above example Student_details is the name of Relation.

There are two attributes RollNo and Name so Degree is 2. In the relation there are three

tuples(rows) so Cardinality is 3.