Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
2 views27 pages

Unix Lab File

The document provides an overview of data, databases, and Database Management Systems (DBMS), explaining their definitions, characteristics, advantages, and disadvantages. It details the components of DBMS, including hardware, software, data, procedures, and database access language, as well as the roles of users such as Database Administrators and Application Programmers. Additionally, it discusses various database architectures and models, including hierarchical, network, entity-relationship, relational, object-oriented, NoSQL, and graph models.

Uploaded by

surajs59589
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views27 pages

Unix Lab File

The document provides an overview of data, databases, and Database Management Systems (DBMS), explaining their definitions, characteristics, advantages, and disadvantages. It details the components of DBMS, including hardware, software, data, procedures, and database access language, as well as the roles of users such as Database Administrators and Application Programmers. Additionally, it discusses various database architectures and models, including hierarchical, network, entity-relationship, relational, object-oriented, NoSQL, and graph models.

Uploaded by

surajs59589
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Day-1

What is Data?
Data is nothing but facts and statistics stored or free flowing
over a network, generally it's raw and unprocessed. For
example: When you visit any website, they might store you IP
address, that is data, in return they might add a cookie in your
browser, marking you that you visited the website, that is data,
your name, it's data, your age, it's data.
Data becomes information when it is processed, turning it into
something meaningful. Like, based on the cookie data saved
on user's browser, if a website can analyse that generally men
of age 20-25 visit us more, that is information, derived from
the data collected.
Day-1
What is a Database?
A Database is a collection of related data organised in a way
that data can be easily accessed, managed and updated.
Database can be software based or hardware based, with one
sole purpose, storing data.
During early computer days, data was collected and stored on
tapes, which were mostly write-only, which means once data is
stored on it, it can never be read again. They were slow and
bulky, and soon computer scientists realised that they needed a
better solution to this problem
Larry Ellison, the co-founder of Oracle was amongst the first
few, who realised the need for a software based Database
Management System.
Day-1
What is DBMS?
A DBMS is a software that allows creation, definition and manipulation of
database, allowing users to store, process and analyse data easily. DBMS
provides us with an interface or a tool, to perform various operations like
creating database, storing data in it, updating data, creating tables in the
database and a lot more.
DBMS also provides protection and security to the databases. It also
maintains data consistency in case of multiple users.
Here are some examples of popular DBMS used these days:
1)MySql 2) Oracle 3) SQL Server 4) IBM DB2
5) Mango DB etc
Day-1
Characteristics of Database Management System
A database management system has following characteristics:
1) Data stored into Tables: Data is never directly stored into the
database. Data is stored into tables, created inside the database. DBMS
also allows to have relationships between tables which makes the data
more meaningful and connected. You can easily understand what type of
data is stored where by looking at all the tables created in a database.
2) Reduced Redundancy: In the modern world hard drives are very
cheap, but earlier when hard drives were too expensive, unnecessary
repetition of data in database was a big problem. But DBMS
follows Normalisation which divides the data in such a way that
repetition is minimum.
Day-1
3 Data Consistency: On Live data, i.e. data that is being
continuosly updated and added, maintaining the consistency of
data can become a challenge. But DBMS handles it all by
itself.
4 Support Multiple user and Concurrent Access: DBMS
allows multiple users to work on it(update, insert, delete data)
at the same time and still manages to maintain the data
consistency.
5 Query Language: DBMS provides users with a simple
Query language, using which data can be easily fetched,
inserted, deleted and updated in a database.
Day-1
6. Security: The DBMS also takes care of the security of data,
protecting the data from un-authorised access. In a typical
DBMS, we can create user accounts with different access
permissions, using which we can easily secure our data by
restricting user access.
7. DBMS supports transactions, which allows us to better
handle and manage data integrity in real world applications
where multi-threading is extensively used
Day -2
Advantages of DBMS
1. Segregation of applicaion program.
2. Minimal data duplicacy or data redundancy.
3. Easy retrieval of data using the Query Language.
4. Reduced development time and maintainance need.
5. With Cloud Datacenters, we now have Database
Management Systems capable of storing almost infinite data.
6. Seamless integration into the application programming
languages which makes it very easier to add a database to
almost any application or website.
Day -2
Disadvantages of DBMS
• It's Complexity
• Except MySQL, which is open source, licensed DBMSs are generally
costly.
• They are large in size.
Components of DBMS
The database management system can be divided into five major
components, they are:
1)Hardware 2) Software 3)Data 4)Procedures
5) Database Access Language
Let's have a simple diagram to see how they all fit
together to form a database management system.
Day -2
1) DBMS Components: Hardware
When we say Hardware, we mean computer, hard disks, I/O
channels for data, and any other physical component involved
before any data is successfully stored into the memory.
When we run Oracle or MySQL on our personal computer,
then our computer's Hard Disk, our Keyboard using which we
type in all the commands, our computer's RAM, ROM all
become a part of the DBMS hardware.
Day -2
2) DBMS Components: software
This is the main component, as this is the program which
controls everything. The DBMS software is more like a
wrapper around the physical database, which provides us with
an easy-to-use interface to store, access and update data.
The DBMS software is capable of understanding the Database
Access Language and intrepret it into actual database
commands to execute them on the DB
Day -2
3.DBMS Components: Data
Data is that resource, for which DBMS was designed. The motive
behind the creation of DBMS was to store and utilise data.
In a typical Database, the user saved Data is present and meta data is
stored.
Metadata is data about the data. This is information stored by the
DBMS to better understand the data stored in it.
For example: When I store my Name in a database, the DBMS will
store when the name was stored in the database, what is the size of the
name, is it stored as related data to some other data, or is it independent,
all this information is metadata.
Day-2
DBMS Components: Procedures
Procedures refer to general instructions to use a database management
system. This includes procedures to setup and install a DBMS, To login and
logout of DBMS software, to manage databases, to take backups, generating
reports etc.
DBMS Components: Database Access Language
Database Access Language is a simple language designed to write commands
to access, insert, update and delete data stored in any database.
A user can write commands in the Database Access Language and submit it to
the DBMS for execution, which is then translated and executed by the
DBMS.
User can create new databases, tables, insert data, fetch stored data, update
data and delete the data using the access language.
Day -3
• Users
Database Administrators: Database Administrator or DBA is the one
who manages the complete database management system. DBA takes
care of the security of the DBMS, it's availability, managing the license
keys, managing user accounts and access etc.
Application Programmer or Software Developer: This user group is
involved in developing and desiging the parts of DBMS.
End User: These days all the modern applications, web or mobile, store
user data. How do you think they do it? Yes, applications are
programmed in such a way that they collect user data and store the data
on DBMS systems running on their server. End users are the one who
store, retrieve, update and delete data.
DBMS Architecture
A Database Management system is not always directly
available for users and applications to access and store data in
it. A Database Management system can be centralised(all the
data stored at one location), decentralised(multiple copies of
database at different locations) or hierarchical, depending
upon its architecture.
1-tier DBMS architecture also exist, this is when the database
is directly available to the user for using it to store data.
Generally such a setup is used for local application
development, where programmers communicate directly with
the database for quick response.
Database Architecture is logically of two types:
2-tier DBMS architecture
3-tier DBMS architecture
2-tier DBMS Architecture
2-tier DBMS architecture includes an Application layer between the
user and the DBMS, which is responsible to communicate the user's
request to the database management system and then send the
response from the DBMS to the user.
An application interface known as ODBC(Open Database Connectivity)
provides an API that allow client side program to call the DBMS. Most
DBMS vendors provide ODBC drivers for their DBMS.
Such an architecture provides the DBMS extra security as it is not
exposed to the End User directly. Also, security can be improved by
adding security and authentication checks in the Application layer too
3-tier DBMS Architecture
3-tier DBMS architecture is the most commonly used
architecture for web applications
It is an extension of the 2-tier architecture. In the 2-tier architecture, we have
an application layer which can be accessed programatically to perform
various operations on the DBMS. The application generally understands the
Database Access Language and processes end users requests to the DBMS.
In 3-tier architecture, an additional Presentation or GUI Layer is added, which
provides a graphical user interface for the End user to interact with the
DBMS.
For the end user, the GUI layer is the Database System, and the end user has
no idea about the application layer and the DBMS system.
If you have used MySQL, then you must have seen PHPMyAdmin, it is the
best example of a 3-tier DBMS architecture.
Types of Database Model
A Database model defines the logical design and structure of a
database. It defines how data will be stored, accessed, and updated in
a database management system.
• As per your application's requirement, you can use a database model
to define your database.
• The database model sets the rule, relationships, constraints, etc. to
define how data is stored in the database.
• It's like creating a blueprint of your Database.
• There are different types of Database models and each one has its
own set of features.
• You can define how you want to structure the application data using a
database model.
Type of Database models
There are several different Database model types, some of them are old,
while some of them are new, to cater to the new age requirements. Here
is a list of the 7 popular Database models:
• Hierarchical Model
• Network Model
• Entity-relationship Model
• Relational Model
• Object-oriented Model
• NoSQL Model
• Graph Model
Hierarchical Model
• The hierarchical database model organizes data into a tree-like
structure, with a single root, to which all the other data is linked.
• The hierarchy starts from the Root data, and expands like a tree,
adding child nodes to the parent nodes.
• In this model, a child node will only have a single parent node.
• This model efficiently describes many real-world relationships like
the index of a book, etc.
• IBM's Information Management System (IMS) is based on this model.
• Data is organized into a tree-like structure with a one-to-many
relationship between two different types of data, for example,
one department can have many courses, many teachers, and of
course many students(like shown in the diagram below).
• Advantages/Disadvantages of the Hierarchical Model
Here are a few points to mark the advantages and disadvantages of the
Hierarchical database model:
Because it has one-to-many relationships between different types of
data so it is easier and fast to fetch the data.
But the Hierarchical model is less flexible.
And it doesn't support many-to-many relationships.
2. Network Model
• The Network Model is an extension of the Hierarchical model.
• In this model, data is organized more like a graph, and allowed to
have more than one parent node.
• In the network database model, data is more related as more
relationships are established in this database model.
• Also, as the data is more related, hence accessing the data is also
easier and fast.
• This database model uses many-to-many data relationships.
• Integrated Data Store (IDS) is based on this database model.
• This was the most widely used database model before Relational
Model was introduced.
• The implementation of the Network model is complex, and it's very
difficult to maintain it.
• The Network model is difficult to modify also.
• You may want to explore this if you are developing some social
networking applications, although the Graph Database model is new
and is far better than the Network Database model.
Advantages of the Network Model
It supports complex relationships
It allows more flexibility
3.Entity-relationship Model
• In this database model, relationships are created by dividing
objects of interest into entities and their characteristics into
attributes.
• Different entities are related using relationships.
• ER Models are defined to represent the relationships in
pictorial form to make it easier for different stakeholders to
understand.
• This model is good to design a database, which can then be
turned into tables in a relational model (explained below).
• Let's take an example, If we have to design a School
Database, then the Student will be
an entity with attributes name, age, address, etc. As
an Address is generally complex, it can be
another entity with attributes street, pincode, city, etc, and
there will be a relationship between them.
• Relationships can also be of different types. You can learn
about ER Diagrams in detail if you want to learn about
entities and relationships
Advantages of the ER Model
It is easy to understand and design.
Using the ER model we can represent data structures easily.
As the ER model cannot be directly implemented into a database model,
it is just a step toward designing the relational database model.
4. Relational Model
• In this model, data is organized in two-dimensional tables and the
relationship is maintained by storing a common field.
• This model was introduced by E.F Codd in 1970, and since then it has
been the most widely used database model.
• The basic structure of data in the relational model is tables. All the
information related to a particular type is stored in rows of that table.
• Hence, tables are also known as relations in the relational model.
• You can design tables, normalize them to reduce data redundancy,
and use Structured Query language or SQL to access data from the
tables.
• Some of the most popular databases are based on this database model.
For example, Oracle, MySQL, etc.
• Advantages of the Relational Model
1)It's simple and easy to implement.
2)Poplar database software is available for this database model.
3)It supports SQL using which you can easily query the data.
5. Object-oriented Model
• In this model, data is stored in the form of objects.
• The behavior of the object-oriented database model is just like
object-oriented programming.
• A very popular example of an Object Database management
system or ODBMS is MongoDB which is also a NoSQL
database.
• This database model is not mature enough as compared to the
relational database model.
Advantages of the Object-oriented Model
1)It can easily support complex data structures, with relationships.
2)It also supports features like Inheritance, Encapsulation, etc.
Basic Concepts of ER Model in DBMS
As we described in the tutorial Database models, Entity-relationship model is
a model used for design and representation of relationships between data.
The main data objects are termed as Entities, with their details defined as
attributes, some of these attributes are important and are used to identity the
entity, and different entities are related using relationships.
In short, to understand about the ER Model, we must understand about:
• Entity and Entity Set
• What are Attributes? And Types of Attributes.
• Keys .Relationships

You might also like