0% found this document useful (0 votes)
9 views

Unit 1 Database Concepts and Architecture bitinfoNepal

database concept

Uploaded by

bit student
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Unit 1 Database Concepts and Architecture bitinfoNepal

database concept

Uploaded by

bit student
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Prepared by Prabesh Bhandari (For 3rd Sem BIT, TU)

Unit -1 Database Concepts and Architecture

1. Advantages of DBMS approach over file system approach.

File Management system is a DBMS that allows access to single files or tables at a time. In a File System,
data is directly stored in a set of files. A Database Management System (DBMS) is application software
that allows users to efficiently define, create, maintain and share databases.

Advantages of DBMS over File system:

a) Data redundancy and inconsistency: Redundancy is the concept of repetition of data i.e. each data
may have more than a single copy. The file system cannot control the redundancy of data as each user
defines and maintains the needed files for a specific application to run. As there is no or less redundancy
in DBMS, data remains consistent.

b) Data sharing: The file system does not allow sharing of data or sharing is too complex. Whereas in
DBMS, data can be shared easily due to a centralized system.

c) Data concurrency: Concurrent access to data means more than one user is accessing the same data at
the same time. Anomalies occur when changes made by one user get lost because of changes made by
another user. The file system does not provide any procedure to stop anomalies. Whereas DBMS provides
a locking system to stop anomalies to occur.

d) Data searching: For every search operation performed on the file system, a different application
program has to be written. While DBMS provides inbuilt searching operations. The user only has to write
a small query to retrieve data from the database.

e) Data security: A file system provides a password mechanism to protect the database but how long can
the password be protected? No one can guarantee that. This doesn’t happen in the case of DBMS. DBMS
has specialized features that help provide shielding to its data.

f) Easy Maintenance: It is easily maintainable due to its centralized nature.

2. What is database management system? Write its feature.

A Database Management System (DBMS) is application software that allows users to efficiently define,
create, maintain and share databases. DBMS also serves as an interface between the database and end
users or application programs. It provides control access to the data and ensures that data is consistent
and correct by defining rules on them. Its features are:

a) Data Integrity: Data Integrity is maintained in a Database Management System. This means that the
structure of the database can change, but the application that uses the data does not have to change.
Prepared by Prabesh Bhandari (For 3rd Sem BIT, TU)

b) Data Consistency: Data Consistency is also maintained in a Database Management System. The data is
identical regardless of who is inspecting it.

c) Data Redundancy or Data Duplication is Minimized: In a database management system, information


is kept concise and only appears once to avoid data unpredictability. This is done using a technique called
Normalization (Database normalization is the process of structuring a database, usually a relational
database, in accordance with a series of so called normal forms in order to reduce data redundancy and
improve data integrity).

d) Data Accessibility: One of the main benefits of a Database Management System is that the same
business data can be made available to various personnel at any time and from any location. A database
management system (DBMS) allows multiple users to access information that is accessible remotely and
twenty-four hours a day, seven days a week.

e) Data Security: In DBMSs, Data is housed in a secure central location, and many access privileges can be
assigned to multiple people.

3. Differentiate between Database Manager and database Administrator.

Database Manager Database Administrator


As a database manager, you manage and update a
A database administrator, on the other hand,
database. They do not delete or create a database
works to create or design, update, manage, and
from scratch. delete databases.
Database Manager supervises Database
The administrator essentially has more freedom
Administrator to work. and responsibilities compared to a database
manager. However, the database administrator is
usually under the supervision of a database
manager.
The manager does have some knowledge of the The administrator needs a high level of knowledge
database, but they do not need the same regarding how a database works.
expertise as the administrator.

4. What are different types of Database users and their roles?

There are a number of users who can access or retrieve the data on demand using the application and the
interfaces provided by the Database Management System (DBMS). The users of the database can be
classified into the following groups –

a) Database Administrator (DBA) − It is a person or the group in charge of implementing the database
system within the organization. The DBA has all the privileges allowed by the DBMS and can assign or
remove the privileges from the users.
Prepared by Prabesh Bhandari (For 3rd Sem BIT, TU)

b) Application Programmer − The application programmer users who are responsible for developing the
application programs or user interface. The application programs could be written in high level language.
For example − Java, .net, php etc,

c) End Users:
i) Native users − The native users need not be aware of the presence of the database system. They are
end users of the database who works through a menu driven application programs, where the type and
range of response is always indicated to the user

ii) Online Users − Online users may communicate with databases directly through an online terminal or
indirectly through user interface and application programs.

iii) Sophisticated Users − They are those users who interact with the system without writing the program
instead they form their request in database query language. They are the SQL programmers, who are
going to deal directly with the database. They write queries to delete or select or insert and update the
database.

iv) Specialized Users − Specialized users who write specialized database applications that do not fit into
the fractional database processing framework.

v) Standalone Users – They maintain personal databases by using ready-made, program packages that
provide easy-to-use menu based or graphic based interface.

5. Explain the Data independence and Data encryption with example.

i) Data Independence - Data Independence is defined as a property of DBMS that helps you to change the
Database schema at one level of a database system without requiring to change the schema at the next
higher level. There are two kinds of data independence:

a) Logical Data Independence - Logical data independence indicates that the conceptual schema can be
changed without affecting the existing external schemas. The change would be absorbed by the mapping
between the external and conceptual levels. Logical data independence also insulates application
programs from operations such as combining two records into one or splitting an existing record into two
or more records. This would require a change in the external/conceptual mapping so as to leave the
external view unchanged. Eg: Merging two records into one, Breaking an existing record into two or more
records, etc.

b) Physical Data Independence - Physical data independence indicates that the physical storage structures
or devices could be changed without affecting conceptual schema. The change would be absorbed by the
mapping between the conceptual and internal levels. Conceptual level to internal level mapping, provides
a means to go from the conceptual view (conceptual records) to the internal view and hence to the stored
data in the database (physical records). The Logical data independence is difficult to achieve than physical
data independence as it requires the flexibility in the design of database. Eg: Using a new storage device
like Hard Drive or Magnetic Tapes
Prepared by Prabesh Bhandari (For 3rd Sem BIT, TU)

ii) Data Encryption - A DBMS can use encryption to protect information in certain situations where the
normal security mechanisms of the DBMS are not adequate. For example, an intruder may steal tapes
containing some data or tap a communication line. By storing and transmitting data in an encrypted form,
the DBMS ensures that such stolen data is not intelligible to the intruder. Thus, encryption is a technique
to provide privacy of data. The process of converting the plaintext to ciphertext is called as Encryption
and process of converting the ciphertext to plaintext is called as Decryption. Encryption is performed at
the transmitting end and decryption is performed at the receiving end.

6. Who is data administrator? What are the main function of database administrator?

A Database Administrator (DBA) in Database Management System (DBMS) is a professional who works on
creating, maintaining, querying, and tuning the database of the organization. They are also responsible
for maintaining data security and integrity. DBA’s roles are as follows:

- They maintain and run the databases and servers of the organization.

- They work on developing SQL queries and stored procedures to meet the requirements of the business.

- They design schemas, build data structures, table indexes, and relationships.

- They merge data from numerous data sources and store them in a data warehouse.

7. Differentiate between two-tier and three-tier client/server architecture.

Two-Tier Database Architecture Three-Tier Database Architecture


It is a Client-Server Architecture. It is a Web-based application.
In two-tier, the application logic is either In three-tier, the application logic or process resides
buried inside the user interface on the in the middle-tier, it is separated from the data and
client or within the database on the the user interface.
server (or both).
Two-tier architecture consists of two Three-tier architecture consists of three layers:
layers: Client Tier and Database (Data Client Layer, Server Layer and Data Layer.
Tier).
It is easy to build and maintain. It is complex to build and maintain.
Two-tier architecture runs slower. Three-tier architecture runs faster.
Prepared by Prabesh Bhandari (For 3rd Sem BIT, TU)

It is less secured as client can It is secured as client is not allowed to communicate


communicate with database directly. with database directly.
It results in performance loss whenever
It results in performance loss whenever the system
the users increase rapidly. is run on Internet but gives more performance than
two-tier architecture.
Example – Contact Management System Example – Designing registration form which
created using MS-Access or Railway contains text box, label, button or a large website
Reservation System, etc. on the Internet, etc.

8. Explain Three-Schema architecture.

The main objective of three level architecture is to enable multiple users to access the same data with a
personalized view while storing the underlying data only once. Thus it separates the user's view from the
physical structure of the database.

a) 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 that how the data will be stored in a block. The physical level is used to describe
complex low-level data structures in detail.

b) 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 are 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.
Prepared by Prabesh Bhandari (For 3rd Sem BIT, TU)

c) External Level - At the external level, a database contains several schemas that sometimes called as
subschema. The subschema is used to describe the different view 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 and hides the remaining database from that user group. The view schema describes the end
user interaction with database systems.

9. Explain Relational database.

A relational database is a type of database that stores and provides access to data points that are related
to one another. Relational databases are based on the relational model, an intuitive, straightforward way
of representing data in tables. In a relational database, each row in the table is a record with a unique ID
called the key. The columns of the table hold attributes of the data, and each record usually has a value
for each attribute, making it easy to establish the relationships among data points. The key advantages of
relational databases include the following:

- Categorizing data: Database administrators can easily categorize and store data in a relational database
that can then be queried and filtered to extract information for reports. Relational databases are also easy
to extend and aren't reliant on physical organization.

-Accuracy: Data is stored just once, eliminating data deduplication in storage procedures.

-Ease of use: Complex queries are easy for users to carry out with SQL, the main query language used with
relational databases.

-Collaboration: Multiple users can access the same database.

-Security: Database is secure to use and maintain.

10. What is database system architecture? Describe its types.

A Database Architecture is a representation of DBMS design. It helps to design, develop, implement, and
maintain the database management system. A DBMS architecture allows dividing the database system
into individual components that can be independently modified, changed, replaced, and altered. It also
helps to understand the components of a database. Its types are:

a) 1-Tier Architecture: 1 Tier Architecture in DBMS is the simplest architecture of Database in which the
client, server, and Database all reside on the same machine. A simple one tier architecture example would
be anytime you install a Database in your system and access it to practice SQL queries. But such
architecture is rarely used in production.
Prepared by Prabesh Bhandari (For 3rd Sem BIT, TU)

Fig: Single Tier Architecture

b) 2-Tier Architecture: A 2 Tier Architecture in DBMS is a Database architecture where the presentation
layer runs on a client (PC, Mobile, Tablet, etc.), and data is stored on a server called the second tier. Two
tier architecture provides added security to the DBMS as it is not exposed to the end-user directly. It also
provides direct and faster communication. Eg: A Contact Management System created using MS- Access.

Fig: Two Tier Architecture

c) 3-Tier Architecture: A 3 Tier Architecture in DBMS is the most popular client server architecture in
DBMS in which the development and maintenance of functional processes, logic, data access, data
storage, and user interface is done independently as separate modules. Three Tier architecture contains
a presentation layer, an application layer, and a database server.

3-Tier database Architecture design is an extension of the 2-tier client-server architecture. A 3-tier
architecture has the following layers:

Presentation layer (your PC, Tablet, Mobile, etc.), Application layer (server) and Database Server
Prepared by Prabesh Bhandari (For 3rd Sem BIT, TU)

Fig: Three Tier Architecture

11. What is data abstraction? Discuss three levels of this abstraction.

This process of hiding irrelevant details from user is called data abstraction. The term “irrelevant” used
here with respect to the user, it doesn’t mean that the hidden data is not relevant with regard to the
whole database. It just means that the user is not concerned about that data.

Three levels of abstraction are as follows:

Physical level: This is the lowest level of data abstraction. It describes how data is actually stored in
database. You can get the complex data structure details at this level.

Logical level: This is the middle level of 3-level data abstraction architecture. It describes what data is
stored in database.

View level: Highest level of data abstraction. This level describes the user interaction with database
system.
Prepared by Prabesh Bhandari (For 3rd Sem BIT, TU)

13. Explain different data models with example.

Data Models are fundamental entities to introduce abstraction in a DBMS. Data models define how data
is connected to each other and how they are processed and stored inside the system.

a) Entity-Relationship Data Model: Entity-Relationship (ER) Model is based on the notion of real-world
entities and relationships among them. While formulating real-world scenario into the database model,
the ER Model creates entity set, relationship set, general attributes and constraints. ER Model is best used
for the conceptual design of a database.
ER Model is based on:
- Entities and their attributes.
- Relationships among entities.

b) Relational Data Model: The most popular data model in DBMS is the Relational Model. It is more
scientific a model than others. This model is based on first-order predicate logic and defines a table as an
n-ary relation.

c) Hierarchical Data Model: Hierarchical Model was the first DBMS model. This model organizes the data
in the hierarchical tree structure. The hierarchy starts from the root which has root data and then it
expands in the form of a tree adding child node to the parent node. This model easily represents some of
the real-world relationships like food recipes, sitemap of a website etc.
Prepared by Prabesh Bhandari (For 3rd Sem BIT, TU)

d) Network Data Model: This model is an extension of the hierarchical model. It was the most popular
model before the relational model. This model is the same as the hierarchical model, the only difference
is that a record can have more than one parent. It replaces the hierarchical tree with a graph.

e) Object-Oriented Data Model: The real-world problems are more closely represented through the
object-oriented data model. In this model, both the data and relationship are present in a single structure
known as an object. We can store audio, video, images etc in the database which was not possible in the
relational model (although you can store audio and video in relational database, it is advised not to store
in the relational database). In this model, two are more objects are connected through links.
Prepared by Prabesh Bhandari (For 3rd Sem BIT, TU)

15. What is data definition language? How is it different from data manipulation language?

DDL: DDL is Data Definition Language which is used to define data structures. For example: create table,
alter table are instructions in SQL.

DML: DML is Data Manipulation Language which is used to manipulate data itself. For example: insert,
update, delete are instructions in SQL.

DDL DML
It stands for Data Definition Language. It stands for Data Manipulation Language.
It is used to create database schema and can be It is used to add, retrieve or update the data.
used to define some constraints as well.
It basically defines the column (Attributes) of the
It adds or update the row of the table. These rows
table. are called as tuple.
It doesn’t have any further classification. It is further classified into Procedural and Non-
Procedural DML.
Basic commands present in DDL are CREATE, BASIC commands present in DML are UPDATE,
DROP, RENAME, ALTER etc. INSERT, MERGE etc.
DDL does not use WHERE clause in its statement. While DML uses WHERE clause in its statement.

16. Explain Data Models, Schemas and instances.

Data Models - Data Models are fundamental entities to introduce abstraction in a DBMS. Data models
define how data is connected to each other and how they are processed and stored inside the system.
Some of the data models are ER Data Models, Relational Data Models, Hierarchical Data Models, Network
Data Models, Object Oriented Data Models, etc.

Schemas - The overall design of the database is known as database schemas. According to the level of
abstraction, schemas are divided into three types: Internal, Conceptual and External Schemas. Internal
schemas describe the database design at the logical level. Conceptual Schemas describe the database
design at logical level. External Schemas describe the database at the view level. The view schema
describes the end user interaction with database systems.

Instances - Database changes over time as information is inserted, deleted and updated. The collection of
information stored in database at a particular time is called an instance of database.
Prepared by Prabesh Bhandari (For 3rd Sem BIT, TU)

17. Differentiate between centralized DBMS and distributed DBMS.

Basis of Comparison Centralized database Distributed database


Definition It is a database that is stored, located as It is a database that consists of multiple
well as maintained at a single location only. databases which are connected with each
other and are spread across different
physical locations.
Access time The data access time in the case of multiple The data access time in the case of multiple
users is more in a centralized database. users is less in a distributed database.
Management of data The management, modification, and The management, modification, and backup
backup of this database are easier as the of this database are very difficult as it is
entire data is present at the same location. spread across different physical locations.
Failure The users cannot access the database in In a distributed database, if one database
case of database failure occurs. fails users have access to other databases.
Cost A centralized database is less costly. This database is very expensive.
Maintenance Ease of maintenance because the whole of It is difficult to maintain because of the
the data and information is available at a distribution of data and information at
single location. varied places.
Efficient A centralized database is less efficient as A distributed database is more efficient than
data finding becomes quite complex a centralized database because of the
because of the storing of data and splitting up of data at several places.
information at a particular place.
Examples • A desktop or server CPU • Apache Ignite
• A mainframe computer. • Apache HBase

You might also like