Unit 1
Unit 1
• 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:
• Hardware
• Software
• Data
• Procedures
• Database Access Language
• 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.
• 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.
• 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
programmatically 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.
• DBMS Database Models
• A Database model defines the logical design and structure
of a database and defines how data will be stored,
accessed and updated in a database management
system. While the Relational Model is the most widely
used database model, there are other models too:
• Hierarchical Model
• Network Model
• Entity-relationship Model
• Relational Model
Hierarchical Model
• This database model organises data into a tree-like-structure, with a
single root, to which all the other data is linked.
• The heirarchy 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.
• include student_id, (student_id, name), phone etc.
• The first one is pretty simple as student_id is unique for every row of
data, hence it can be used to identity each row uniquely.
• For example: If you have a column dob to save date of births of a set of people, then you cannot
or you must not save 'names' of some of them in that column along with 'date of birth' of others in
that column. It should hold only 'date of birth' for all the records/rows.
101 Akon OS
101 Akon CN
102 Bkon C
• But this is not true all the time. So now let's extend our
example to see if more than 1 column together can act as
a primary key.
Let's create another table for Subject,
which will
have subject_id and subject_name fields
and subject_id will be the primary key.
subject_id subject_name
1 Java
2 C++
3 Php
Now we have a Student table with student information and
another table Subject for storing subject information.
• Now as we just discussed that the primary key for this table is a
composition of two columns which is student_id & subject_id but the
teacher's name only depends on subject, hence the subject_id, and has
nothing to do with student_id.