You are on page 1of 14

INDIRA GANDHI DELHI TECHNICAL

UNIVERSITY FOR WOMEN

DATABASE AND MANAGEMENT SYSTEM (DBMS)


PRACTICAL FILE

Submitted to: Submitted by:


Ms. Nidhi Arora Akanksha Jha
B.TECH, IT
012010302021
INDEX

S.No. Problem Statement Date Teacher’s


Signature
1. Introduction to DBMS 26.08.2022

2. More Details on DBMS 02.09.2022


Problem statements (26 Aug)

1. What are the main differences between file processing and DBMS

The file system is basically a way of arranging the files in a storage medium like a hard
disk. The file system organizes the files and helps in the retrieval of files when they are
required. File systems consist of different files which are grouped into directories. The
directories further contain other folders and files. The file system performs basic
operations like management, file naming, giving access rules, etc.

Database Management System is basically 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.
Eg:- Oracle, MySQL, MongoDB

File system DBMS

A software that manages and Software for managing the database


organises the files in a hard disk
storage medium within computer

Redundant data can be present No data redundancy is there

Doesn't provide backup and recovery of data Backup and recovery of data is there even if
if lost. data is lost , however the delay time to switch
You can not retrieve the data once it's out of control over backup may take few seconds. (
the system. Eg. 26/11 attack in New York affected the
stocks database and to shift the control to
backup it took 11s which thereby resulted in
trillions of losses).

No efficient query processing in file system Efficient query processing is there in DB.
With the help of the queries, a small chunk of
data or the whole can be retrieved.

Less complex as compared to DBMS and More complexity is involved, easier to


therefore cannot be used for complex implement complex transactions
transactions

Security concerns are there, even if it is More security mechanisms


password protected

No data independence Data independence are there . logical and


physical

Only one user can access data at a time Many can access, also user system has the
control for type and privileges to the users

COBOL, C++ Oracle, MySQL

2. Define the following terms :

(a) Data dictionary

As the name suggests it is a dictionary (collection) of data. It is a collection of


(metadata) names, definitions, and attributes about the data elements that are being
used or captured in a DB.
The data dictionary is very important as it contains information such as what is in the
database, who is allowed to access it, where is the database physically stored etc. The
users of the database normally don't interact with the data dictionary, it is only handled
by the database administrators.

Contents in data dictionary:


- Names of all the database tables and their schemas.
- Details about all the tables in the database, such as their owners, their security
constraints, when they were created etc.
- Physical information about the tables such as where they are stored and how.
- Table constraints such as primary key attributes, foreign key information etc.
- Information about the database views that are visible.

(b) DBMS Catalogue

A database catalog is a function included on a server that allows users and


administrators to check information on every database installed on that server. Along
with common information, a database catalog also holds metadata on every database,
such as how many tables and rows are being used in a particular database. One way for
administrators to check database changes is by going through the catalog, because this
saves all recent changes to the database along with information on the people who
made the changes. Users typically do not have access, or they have limited access, to the
catalog; the catalog automatically has an email link so users can email administrators
and request access.

(c ) Query Language
Query language (QL) refers to any computer programming language that requests and
retrieves data from database and information systems by sending queries. It works on
user entered structured and formal programming command based queries to find and extract
data from host databases.
Query language may also be termed database query language.
Query language is primarily created for creating, accessing and modifying data in and out from
a database management system (DBMS). Typically, QL requires users to input a structured
command that is similar and close to the English language querying construct.

For example, the SQL query: SELECT * FROM

(d) Metadata

Metadata is simply defined as data about data. It means it is a description and context of the
data. It helps to organize, find and understand data.
Metadata about the picture captured
File name,
Size of the file,
Date and time,
Camera settings etc

Relational databases store and provide access not only data but also metadata in a structure
called data dictionary or system catalog. It holds information about:
tables,
columns,
data types,
table relationship,
constraints etc.

(e) Data Definition Language ( DDL)

A data definition language (DDL) is a computer language used to create and modify the
structure of database objects in a database. These database objects include views, schemas,
tables, indexes, etc. This term is also known as data description language in some contexts, as
it describes the fields and records in a database table.

It is used to establish and modify the structure of objects in a database by dealing with
descriptions of the database schema. Commonly used DDL in SQL querying are CREATE,
ALTER, DROP, and TRUNCATE.

(f) Data Manipulation Language (DML)

Data Manipulation Language or DML is a subset of operations used to insert, delete, and
update data in a database. A DML is often a sublanguage of a more extensive language like SQL;
DML comprises some of the operators in the language. Selecting read-only data is closely
related and is sometimes also considered a component of a DML, as some users can perform
both read and write selection.

A popular data manipulation language is Structured Query Language or SQL, used to retrieve
and manipulate data in a relational database. With SQL, you can perform operations on the
database and also use it to create a database. SQL uses specific commands like Create, Drop,
Insert, etc., to carry out the required tasks. Examples are INSERT, SELECT, UPDATE, and
DELETE commands

3. Define main components of DBMS

Common components that are universal across all DBMS software, including:

1. Storage engine
2. Query language
3. Query processor
4. Optimization engine
5. Metadata catalog
6. Log manager
7. Reporting and monitoring tools
8. Data utilities

Storage engine

The storage engine is the core component of the DBMS that interacts with the file system
at an OS level to store data. All SQL queries which interact with the underlying data go
through the storage engine.

Query language

A database access language is required for interacting with a database, from creating
databases to simply inserting or retrieving data. A proper DBMS must support one or
multiple query languages and language dialects. Structured query language (SQL) and
MongoDB Query Language (MQL) are two query languages that are used to interact with
the databases.

In many query languages, the query language functionality can be further categorized
according to specific tasks:

Data Definition Language (DDL). This consists of commands that can be used to define
database schemas or modify the structure of database objects.
Data Manipulation Language (DML). Commands that directly deal with the data in the
database. All CRUD operations come under DML.
Data Control Language (DCL). This deals with the permissions and other access controls
of the database.
Transaction Control Language (TCL). Command which deals with internal database
transactions.

Query processor

This is the intermediary between the user queries and the database. The query processor
interprets the queries of users and makes them actionable commands that can be
understood by the database to perform the appropriate functionality.

Optimization engine

The optimization Engine allows the DBMS to provide insights into the performance of the
database in terms of optimizing the database itself and queries. When coupled with
database monitoring tools, it can provide a powerful toolset to gain the best performance
out of the database.

Metadata catalog

This is the centralized catalog of all the objects within the database. When an object is
created, the DBMS keeps a record of that object with some metadata about it using the
metadata catalog. Then, this record can be used to:

Verify user requests to the appropriate database objects


Provide an overview of the complete database structure Log manager
This component will keep all the logs of the DBMS. These logs will consist of user logins
and activity, database functions, backups and restore functions, etc. The log manager
ensures all these logs are properly recorded and easily accessible.

Reporting & monitoring tools

Reporting and monitoring tools are another standard component that comes with a
DBMS. Reporting tools will enable users to generate reports while monitoring tools enable
monitoring the databases for resource consumption, user activity, etc.

Data utilities

In addition to all the above, most DBMS software comes with additional inbuilt utilities to
provide functionality such as:

Data integrity checks


Backup and restore
Simple database repair
Data validations
4. Explain various types of data users and the role of an administrator.

Database users are categorized based on their interaction with the database.

Database Administrator (DBA) :

Database Administrator (DBA) is a person/team who defines the schema and also controls
the 3 levels of the database.
The DBA will then create a new account id and password for the user if he/she need to
access the database.
DBA is also responsible for providing security to the database and he allows only the
authorized users to access/modify the database.
DBA also monitors the recovery and backup and provides technical support.
The DBA has a DBA account in the DBMS which is called a system or superuser account.
DBA repairs damage caused due to hardware and/or software failures.

Naive / Parametric End Users:

Parametric End Users are the unsophisticated who don’t have any DBMS knowledge but
they frequently use the database applications in their daily life to get the desired results.

For example, Railway’s ticket booking users are naive users. Clerks in any bank are naive
users because they don’t have any DBMS knowledge but they still use the database and
perform their given task.

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 analysts, who are familiar with
the database. They can develop their own database applications according to their
requirements. They don’t write the program code but they interact with the database by
writing SQL queries directly through the query processor.

Database Designers:

Database Designers are the users who design the structure of a database 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 write the code for the application
programs. They are computer professionals. These programs could be written in
Programming languages such as Visual Basic, Developer, C, FORTRAN, COBOL etc.
Problem statements (2 Sept)

Q1. Differentiate between physical data independence and logical data independence?

Physical Data Independence Logical Data Independence

It is mainly concerned about how the data It is mainly concerned about the structure
is stored into the system. or the changing data definition.

It is easy to retrieve. It is difficult to retrieve because the data is


mainly dependent on the logical structure
of data.

As compared to logical independence it is As compared to physical independence it


easy to achieve physical data is not easy to achieve logical data
independence. independence.

Any change at the physical level, does not The change in the logical level requires a
require to change at the application level. change at the application level.

The modifications made at the internal The modifications made at the logical
level may or may not be needed to improve level are significant whenever the logical
the performance of the structure. structure of the database is to be changed.

It is concerned with the internal schema. It is concerned with conceptual schema.

Example: Change in compression Example: Add/Modify or Delete a new


techniques, Hashing algorithms and attribute.
storage devices etc.

Q2. Differentiate between relation and relation schema?

Relation schema: A set of attributes is called a relation schema (or relation scheme). A
relation schema is also known as table schema (or table scheme). A relation schema can be
thought of as the basic information describing a table or relation. It is the logical definition of
a table. Relation schema defines what the name of the table is. This includes a set of column
names, the data types associated with each column.
Relational schema may also refer to as database schema. A database schema is the collection
of relation schemas for a whole database. Relational or Database schema is a collection of
meta-data. Database schema describes the structure and constraints of data representing a
particular domain. A Relational schema can be described as a blueprint of a database that
outlines the way data is organized into tables. This blueprint will not contain any type of data.
In a relational schema, each tuple is divided into fields called Domains.

Q3. Describe the 3 schema architectures. Why do we need mapping between schema levels ?
How do different schema definitions support this architecture?

● The three schema architecture is also called ANSI/SPARC architecture or three-level


architecture.
● This framework is used to describe the structure of a specific database system.
● The three schema architecture is also used to separate the user applications and
physical database.
● The three schema architecture contains three-levels. It breaks the database down into
three different categories.

1.Internal Level

● The internal level has an internal schema which describes the physical storage

structure of the database.

● The internal schema is also known as a physical schema.

● It uses the physical data model. It is used to define how the data will be stored in a

block.

● The physical level is used to describe complex low-level data structures in detail.

The internal level is generally is concerned with the following activities:

● Storage space allocations.

For Example: B-Trees, Hashing etc.

● Access paths.

For Example: Specification of primary and secondary keys, indexes, pointers and

sequencing.

● Data compression and encryption techniques.

● Optimization of internal structures.

● Representation of stored fields.


2. Conceptual Level

● The conceptual schema describes the design of a database at the conceptual level.

Conceptual level is also known as logical level.

● The conceptual schema describes the structure of the whole database.

● The conceptual level describes what data is to be stored in the database and also

describes what relationship exists among those data.

● In the conceptual level, internal details such as an implementation of the data structure

are hidden.

● Programmers and database administrators work at this level.

3. External Level

● At the external level, a database contains several schemas that are sometimes called

subschemas. The subschema is used to describe the different views of the database.

● An external schema is also known as view schema.

● Each view schema describes the database part that a particular user group is interested

in and hides the remaining database from that user group.

● The view schema describes the end user interaction with database systems.

The three levels of DBMS architecture don't exist independently of each other. There must be
correspondence between the three levels i.e. how they actually correspond with each other.
DBMS is responsible for correspondence between the three types of schema. This
correspondence is called Mapping.

In a three schema approach, most data-related description languages or tools associated with

schemas focus on the "physical level" and "view level", with the "conceptual level" mostly

used in combining the schema design itself. In relational databases, the physical model is

explained using SQL DDL. Physical schemas in NoSQL can be fixed to particular records using

JSON or XML. There are some languages to describe conceptual schemas. But nowadays

languages are not used for conceptual schemas but instead Entity relationship models, a

diagramming and description tool is used. The "view level" or "external level" is implemented

outside of data managers in user-side code. This is done using object relational mapping with

the help of tools like Hibernate. These tools convert "physical layer" schema structure to
"external-friendly" structures. Here the user input UI elements are given to the application

code. Code having a "database layer" is implemented inside the API.

Q4: List down the differences between hierarchical data model and network data model.

Sr. Key Hierarchical Data Model Network Data Model


No.

1 Basic Relationship between Relationship between records is


records is of the parent child expressed in the form of pointers
type or links.

2 Data It can have data No Data inconsistency


Inconsistency inconsistency during the
updation and deletion of the
data

3 Traversing Traversing of data is Data traversing is easy because


complex node can be accessed from parent
to child or child to parent

4 Relationship It does not support many to It support many to many


many relationships relationships

5 Structure Its create tree like structure It support graph like structure

You might also like