CSE - 311L, Lab - 01

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

COURSE: CSE-311L Database Management System

LAB: 01
INSTRUCTOR: Azmary Zannat Aurin

Objectives: Getting introduced with the concepts of DBMS.

What is DBMS:
DBMS stands for Database Management System. It is a software which is used to manage the
database. For example, MySQL, Oracle etc are very popular commercial database which is used
in different applications.
Database refers to collection of interrelated data, Management System includes Set of programs
to access and manipulate the data in an efficient way. Therefore, DBMS provides an interface to
perform various operations like database creation, storing data in it, updating data, creating a
table in the database and a lot more. It provides protection and security to the database. In the
case of multiple users, it also maintains data consistency.

Database Applications:
o Banking: transactions
o Airlines: reservations, schedules
o Universities: registration, grades
o Sales: customers, products, purchases
o Online retailers: order tracking, customized recommendations
o Manufacturing: production, inventory, orders, supply chain
o Human resources: employee records, salaries, tax deductions
Drawbacks of using file systems to store data:
File based systems were an early attempt to computerize the manual system.
• Data redundancy and inconsistency
• Multiple file formats, duplication of information in different files. Due to the
centralization of the database, the problems of data redundancy and inconsistency
are controlled. In this, the files and application programs are created by different
programmers so that there exists a lot of duplication of data which may lead to
inconsistency.
• Difficulty in accessing data
• Need to write a new program to carry out each new task. The file system can't
efficiently store and retrieve the data.
• Data isolation
• Multiple files and formats
• Data security
• It isn't easy to protect a file under the file system.
• Recovery Mechanism
• The file system doesn't have a crash mechanism, i.e., if the system crashes while
entering some data, then the content of the file will be lost. DBMS provides a crash
recovery mechanism, i.e., DBMS protects the user from system failure.
• Examples
• Cobol, C++ etc.

Characteristics of DBMS:
Following are the important characteristics and applications of DBMS.
• ACID Properties − DBMS follows the concepts of Atomicity, Consistency, Isolation,
and Durability (normally shortened as ACID). These concepts are applied on transactions,
which manipulate data in a database. ACID properties help the database stay healthy in
multi-transactional environments and in case of failure.
• Multiuser and Concurrent Access − DBMS supports multi-user environment and allows
them to access and manipulate data in parallel. Though there are restrictions on
transactions when users attempt to handle the same data item, but users are always
unaware of them.

• Multiple views − DBMS offers multiple views for different users. A user who is in the
Sales department will have a different view of database than a person working in the
Production department. This feature enables the users to have a concentrate view of the
database according to their requirements.
• Security − Features like multiple views offer security to some extent where users are
unable to access data of other users and departments. DBMS offers methods to impose
constraints while entering data into the database and retrieving the same at a later stage.
DBMS offers many different levels of security features, which enables multiple users to
have different views with different features. For example, a user in the Sales department
cannot see the data that belongs to the Purchase department. Additionally, it can also be
managed how much data of the Sales department should be displayed to the user. Since a
DBMS is not saved on the disk as traditional file systems, it is very hard for miscreants to
break the code.
• Real-world entity − A modern DBMS is more realistic and uses real-world entities to
design its architecture. It uses the behavior and attributes too. For example, a school
database may use students as an entity and their age as an attribute.
• Relation-based tables − DBMS allows entities and relations among them to form tables.
A user can understand the architecture of a database just by looking at the table names.
• Query Language − DBMS is equipped with query language, which makes it more
efficient to retrieve and manipulate data. A user can apply as many and as different filtering
options as required to retrieve a set of data. Traditionally it was not possible where file-
processing system was used.

What is RDBMS:

RDBMS stands for Relational Database Management Systems..

All modern database management systems like SQL, MS SQL Server, IBM DB2, ORACLE, My-
SQL and Microsoft Access are based on RDBMS.

It is called Relational Data Base Management System (RDBMS) because it is based on relational
model introduced by E.F. Codd.

How it works

Data is represented in terms of tuples (rows) in RDBMS. Relational database is most commonly
used database. It contains number of tables and each table has its own primary key.

Due to a collection of organized set of tables, data can be accessed easily in RDBMS.
What is a table:

The RDBMS database uses tables to store data. A table is a collection of related data entries and
contains rows and columns to store data.

A table is the simplest example of data storage in RDBMS.

Let's see the example of student table.

What is field:

Field is a smaller entity of the table which contains specific information about every record in the
table. In the above example, the field in the student table consist of id, name, age, course.

What is row or record:

A row of a table is also called record. It contains the specific information of each individual entry
in the table. It is a horizontal entity in the table. For example: The above table contains 5 records.

Let's see one record/row in the table.


What is column:

A column is a vertical entity in the table which contains all information associated with a specific
field in a table. For example: "name" is a column in the above table which contains all information
about student's name.

NULL Values:

The NULL value of the table specifies that the field has been left blank during record creation. It
is totally different from the value filled with zero or a field that contains space.

Data Integrity:

There are the following categories of data integrity exist with each RDBMS:

Entity integrity: It specifies that there should be no duplicate rows in a table.

Domain integrity: It enforces valid entries for a given column by restricting the type, the format,
or the range of values.

Referential integrity: It specifies that rows cannot be deleted, which are used by other records.

User-defined integrity: It enforces some specific business rules that are defined by users. These
rules are different from entity, domain or referential integrity.
DBMS Architecture:

o The DBMS design depends upon its architecture. The basic client/server architecture is
used to deal with a large number of PCs, web servers, database servers and other
components that are connected with networks.
o The client/server architecture consists of many PCs and a workstation which are connected
via the network.
o DBMS architecture depends upon how users are connected to the database to get their
request done.

Types of DBMS Architecture:

Database architecture can be seen as a single tier or multi-tier. But logically, database architecture
is of two types like: 2-tier architecture and 3-tier architecture.

1-Tier Architecture:
o In this architecture, the database is directly available to the user. It means the user can
directly sit on the DBMS and uses it.
o Any changes done here will directly be done on the database itself. It doesn't provide a
handy tool for end users.
o The 1-Tier architecture is used for development of the local application, where
programmers can directly communicate with the database for the quick response.

2-Tier Architecture:
o The 2-Tier architecture is same as basic client-server. In the two-tier architecture,
applications on the client end can directly communicate with the database at the server side.
For this interaction, API's like: ODBC, JDBC are used.
o The user interfaces and application programs are run on the client-side.
o The server side is responsible to provide the functionalities like: query processing and
transaction management.
o To communicate with the DBMS, client-side application establishes a connection with the
server side.
3-Tier Architecture:
o The 3-Tier architecture contains another layer between the client and server. In this
architecture, client can't directly communicate with the server.
o The application on the client-end interacts with an application server which further
communicates with the database system.
o End user has no idea about the existence of the database beyond the application server. The
database also has no idea about any other user beyond the application.
o The 3-Tier architecture is used in case of large web application.

You might also like