You are on page 1of 33

1. Define Database?

A database is an organized collection of structured information, or data, typically stored


electronically in a computer system. A database is usually controlled by a database
management system (DBMS).
2. Discuss about applications of Database Systems?
There are different fields where a database management system is utilized. Following are a
few applications which utilize the information base administration framework –

Railway Reservation System –


In the rail route reservation framework, the information base is needed to store the record
or information of ticket appointments, status about train’s appearance, and flight.
Additionally, if trains get late, individuals become acquainted with it through the
information base update.

Library Management System –


There are loads of books in the library so; it is difficult to store the record of the relative
multitude of books in a register or duplicate. Along these lines, the data set administration
framework (DBMS) is utilized to keep up all the data identified with the name of the book,
issue date, accessibility of the book, and its writer.

Banking –
Database the executive’s framework is utilized to store the exchange data of the client in
the information base.

Education Sector –
Presently, assessments are led online by numerous schools and colleges. They deal with all
assessment information through the data set administration framework (DBMS). In spite of
that understudy’s enlistments subtleties, grades, courses, expense, participation, results,
and so forth all the data is put away in the information base.
Credit card exchanges –
The database Management framework is utilized for buying on charge cards and age of
month to month proclamations.

Social Media Sites –


We all utilization of online media sites to associate with companions and to impart our
perspectives to the world. Every day, many people group pursue these online media
accounts like Pinterest, Facebook, Twitter, and Google in addition to. By the utilization of
the data set administration framework, all the data of clients are put away in the
information base and, we become ready to interface with others.

Broadcast communications –
Without DBMS any media transmission organization can’t think. The Database the
executive’s framework is fundamental for these organizations to store the call subtleties
and month to month postpaid bills in the information base.

Account –
The information base administration framework is utilized for putting away data about
deals, holding and acquisition of monetary instruments, for example, stocks and bonds in a
data set.

Online Shopping –
These days, web-based shopping has become a major pattern. Nobody needs to visit the
shop and burn through their time. Everybody needs to shop through web based shopping
sites, (for example, Amazon, Flipkart, Snapdeal) from home. So all the items are sold and
added uniquely with the assistance of the information base administration framework
(DBMS). Receipt charges, installments, buy data these are finished with the assistance of
DBMS.

Human Resource Management –


Big firms or organizations have numerous specialists or representatives working under
them. They store data about worker’s compensation, assessment, and work with the
assistance of an information base administration framework (DBMS).

Manufacturing –
Manufacturing organizations make various kinds of items and deal them consistently. To
keep the data about their items like bills, acquisition of the item, amount, inventory
network the executives, information base administration framework (DBMS) is utilized.

Airline Reservation System –


This framework is equivalent to the railroad reservation framework. This framework
additionally utilizes an information base administration framework to store the records of
flight takeoff, appearance, and defer status.

3. Differentiate between Database Management System and file based system.


Difference between File System and DBMS : 
 

S.NO. File System DBMS

File system is a software that manages and


organizes the files in a storage medium within a DBMS is a software for managing the
1. computer. database.

2. Redundant data can be present in a file system. In DBMS there is no redundant data.

It doesn’t provide backup and recovery of data if It provides backup and recovery of
3. it is lost. data even if it is lost.

There is no efficient query processing in file Efficient query processing is there in


4. system. DBMS.

There is more data consistency


because of the process of
5. There is less data consistency in file system. normalization.
S.NO. File System DBMS

It has more complexity in handling as


6. It is less complex as compared to DBMS. compared to file system.

File systems provide less security in comparison DBMS has more security mechanisms
7. to DBMS. as compared to file system.

It has a comparatively higher cost


8. It is less expensive than DBMS. than a file system.

4. Define internal architecture of DBMS.


The internal schema defines the physical storage structure of the database. The internal
schema is a very low-level representation of the entire database. It contains multiple
occurrences of multiple types of internal record. In the ANSI term, it is also called “stored
record’.

Facts about Internal schema:

The internal schema is the lowest level of data abstraction


It helps you to keeps information about the actual representation of the entire database.
Like the actual storage of the data on the disk in the form of records
The internal view tells us what data is stored in the database and how
It never deals with the physical devices. Instead, internal schema views a physical device as
a collection of physical pages.

5. Explain the role of DBA.


A Database Administrator (DBA) is individual or person responsible for controlling,
maintenance, coordinating, and operation of database management system. Managing,
securing, and taking care of database system is prime responsibility.
They are responsible and in charge for authorizing access to database, coordinating,
capacity, planning, installation, and monitoring uses and for acquiring and gathering
software and hardware resources as and when needed. Their role also varies from
configuration, database design, migration, security, troubleshooting, backup, and data
recovery. Database administration is major and key function in any firm or organization
that is relying on one or more databases. They are overall commander of Database system.
Role and Duties of Database Administrator (DBA) :

Decides hardware –
They decides economical hardware, based upon cost, performance and efficiency of
hardware, and best suits organisation. It is hardware which is interface between end users
and database.
Manages data integrity and security –
Data integrity need to be checked and managed accurately as it protects and restricts data
from unauthorized use. DBA eyes on relationship within data to maintain data integrity.
Database design –
DBA is held responsible and accountable for logical, physical design, external model design,
and integrity and security control.
Database implementation –
DBA implements DBMS and checks database loading at time of its implementation.
Query processing performance –
DBA enhances query processing by improving their speed, performance and accuracy.
Tuning Database Performance –
If user is not able to get data speedily and accurately then it may loss organization
business. So by tuning SQL commands DBA can enhance performance of database.

6. Explain the advantages of DBMS.

Advantage of Database Management System (DBMS):


Some of them are given as following below.

Better Data Transferring:


Database management creates a place where users have an advantage of more and better
managed data. Thus making it possible for end-users to have a quick look and to respond
fast to any changes made in their environment.

Better Data Security:


As number of users increases data transferring or data sharing rate also increases thus
increasing the risk of data security. It is widely used in corporation world where companies
invest money, time and effort in large amount to ensure data is secure and is used
properly. A Database Management System (DBMS) provide a better platform for data
privacy and security policies thus, helping companies to improve Data Security.

Better data integration:


Due to Database Management System we have an access to well managed and
synchronized form of data thus it makes data handling very easy and gives integrated view
of how a particular organization is working and also helps to keep a track on how one
segment of the company affects other segment.

Minimized Data Inconsistency:


Data inconsistency occurs between files when different versions of the same data appear in
different places.
For Example, data inconsistency occurs when a student name is saved as “John Wayne” on
a main computer of school but on teacher registered system same student name is
“William J. Wayne”, or when the price of a product is $86.95 in local system of company
and its National sales office system shows the same product price as $84.95.
So if a database is properly designed then Data inconsistency can be greatly reduced hence
minimizing data inconsistency.
Faster data Access:
The Data base management system (DBMS) helps to produce quick answers to database
queries thus making data accessing faster and more accurate. For example, to read or
update the data. For example, end users, when dealing with large amounts of sale data,
will have enhanced access to the data, enabling faster sales cycle.
Some queries may be like:
What is the increase of the sale in last three months?
What is the bonus given to each of the salespeople in last five months?
How many customers have credit score of 850 or more?

Better decision making:


Due to DBMS now we have Better managed data and Improved data accessing because of
which we can generate better quality information hence on this basis better decisions can
be made.
Better Data quality improves accuracy, validity and time it takes to read data.
DBMS does not guarantee data quality, it provides a framework to make it is easy to
improve data quality .

Increased end-user productivity:


The data which is available with the help of combination of tools which transform data into
useful information, helps end user to make quick, informative and better decisions that can
make difference between success and failure in the global economy.
Simple:
Data base management system (DBMS) gives simple and clear logical view of data. Many
operations like insertion, deletion or creation of file or data are easy to implement.

7. What is Data Abstraction?


Data Abstraction is a process of hiding unwanted or irrelevant details from the end user. It
provides a different view and helps in achieving data independence which is used to
enhance the security of data.

The database systems consist of complicated data structures and relations. For users to
access the data easily, these complications are kept hidden, and only the relevant part of
the database is made accessible to the users through data abstraction.

Levels of abstraction for DBMS


Database systems include complex data-structures. In terms of retrieval of data, reduce
complexity in terms of usability of users and in order to make the system efficient,
developers use levels of abstraction that hide irrelevant details from the users. Levels of
abstraction simplify database design.

Mainly there are three levels of abstraction for DBMS, which are as follows −

Physical or Internal Level


Logical or Conceptual Level
View or External Level
8. Explain about different views of data?
The three-schema architecture defines the view of data at three levels:
Physical level (internal level)
Logical level (conceptual level)
View level (external level)
1. Physical Level/ Internal Level

The physical or the internal level schema describes how the data is stored in the
hardware. It also describes how the data can be accessed. The physical level shows
the data abstraction at the lowest level and it has complex data structures. Only the
database administrator operates at this level.

2. Logical Level/ Conceptual Level

It is a level above the physical level. Here, the data is stored in the form of the entity
set, entities, their data types, the relationship among the entity sets, user operations
performed to retrieve or modify the data and certain constraints on the data. Well
adding constraints to the view of data adds the security. As users are restricted to
access some particular parts of the database.
It is the developer and database administrator who operates at the logical or the
conceptual level.

3. View Level/ User level/ External level

It is the highest level of data abstraction and exhibits only a part of the whole
database. It exhibits the data in which the user is interested. The view level can
describe many views of the same data. Here, the user retrieves the information using
different application from the database.

9. Define Instance and Schema? List different data models and explain?

The data which is stored in the database at a particular moment of time is called an
instance of the database.
The overall design of a database is called schema.
A database schema is the skeleton structure of the database. It represents the logical
view of the entire database.
A schema contains schema objects like table, foreign key, primary key, views,
columns, data types, stored procedure, etc.
A database schema can be represented by using the visual diagram. That diagram
shows the database objects and relationship with each other.
A database schema is designed by the database designers to help programmers
whose software will interact with the database. The process of database creation is
called data modeling.
A schema diagram can display only some aspects of a schema like the name of
record type, data type, and constraints. Other aspects can't be specified through the
schema diagram. For example, the given figure neither show the data type of each
data item nor the relationship among various files.
In the database, actual data changes quite frequently. For example, in the given
figure, the database changes whenever we add a new grade or add a student. The
data at a particular moment of time is called the instance of the database.
10. Draw the Architecture of Database?
DBMS Architecture
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.
The client/server architecture consists of many PCs and a workstation which are
connected via the network.
DBMS architecture depends upon how users are connected to the database to get
their request done.
Types of DBMS Architecture

DBMS Architecture
1-Tier Architecture
In this architecture, the database is directly available to the user. It means the user
can directly sit on the DBMS and uses it.
Any changes done here will directly be done on the database itself. It doesn't provide
a handy tool for end users.

2-Tier Architecture
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.
The user interfaces and application programs are run on the client-side.
3-Tier Architecture
The 3-Tier architecture contains another layer between the client and server. In this
architecture, client can't directly communicate with the server.
The application on the client-end interacts with an application server which further
communicates with the database system.

11. Discuss about Database users and Administrators?


These are seven types of data base users in DBMS.

Database Administrator (DBA) :


Database Administrator (DBA) is a person/team who defines the schema and also
controls the 3 levels of database.
The DBA will then create a new account id and password for the user if he/she need
to access the data base.
DBA is also responsible for providing security to the data base and he allows only the
authorized users to access/modify the data base.
DBA also monitors the recovery and back up and provide technical support.
The DBA has a DBA account in the DBMS which 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 data base applications in their daily life to get the desired
results.
For examples, Railway’s ticket booking users are naive users. Clerks in any bank is a
naive user 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 analyst, who are familiar
with the database. They can develop their own data base applications according to
their requirement. They don’t write the program code but they interact the data
base by writing SQL queries directly through the query processor.

Data Base Designers :


Data Base Designers are the users who design the structure of data base 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 writes the code for the
application programs.They are the computer professionals. These programs could be
written in Programming languages such as Visual Basic, Developer, C, FORTRAN,
COBOL etc.

Casual Users / Temporary Users :


Casual Users are the users who occasionally use/access the data base but each time
when they access the data base they require the new information, for example,
Middle or higher level manager.

12. Draw ER diagram for Ternary Relationship set with suitable example?
In Ternary relationship three different Entities takes part in a Relationship.
Relationship Degree = 3
For Example: Consider a Mobile manufacture company.
Three different entities involved:

 Mobile - Manufactured by company. 


 Part - Mobile Part which company get from Supplier. 
 Supplier - Supplier supplies Mobile parts to Company.
Mobile, Part and Supplier will participate simultaneously in a relationship. because of this fact
when we consider cardinality we need to consider it in the context of two entities simultaneously
relative to third entity.
13. What do you understand by generalization and specialization attributes in
DBMS?
Generalization
o Generalization is like a bottom-up approach in which two or more entities of lower
level combine to form a higher level entity if they have some attributes in common.
o In generalization, an entity of a higher level can also combine with the entities of the
lower level to form a further higher level entity.
o Generalization is more like subclass and superclass system, but the only difference is
the approach. Generalization uses the bottom-up approach.
o In generalization, entities are combined to form a more generalized entity, i.e.,
subclasses are combined to make a superclass.
For example, Faculty and Student entities can be generalized and create a higher
level entity Person.

Specialization
o Specialization is a top-down approach, and it is opposite to Generalization. In
specialization, one higher level entity can be broken down into two lower level
entities.
o Specialization is used to identify the subset of an entity set that shares some
distinguishing characteristics.
o Normally, the superclass is defined first, the subclass and its related attributes are
defined next, and relationship set are then added.
For example: In an Employee management system, EMPLOYEE entity can be
specialized as TESTER or DEVELOPER based on what role they play in the company.

14. Define Entity, Attributes, Entity set, relationship with appropriate notations?
1. Entity:
An entity may be any object, class, person or place. In the ER diagram, an entity can
be represented as rectangles.
Consider an organization as an example- manager, product, employee, department
etc. can be taken as an entity.

a. Weak Entity
An entity that depends on another entity called a weak entity. The weak entity
doesn't contain any key attribute of its own. The weak entity is represented by a
double rectangle.

2. Attribute
The attribute is used to describe the property of an entity. Eclipse is used to
represent an attribute.
For example, id, age, contact number, name, etc. can be attributes of a student.

a. Key Attribute
The key attribute is used to represent the main characteristics of an entity. It
represents a primary key. The key attribute is represented by an ellipse with the text
underlined.
b. Composite Attribute
An attribute that composed of many other attributes is known as a composite
attribute. The composite attribute is represented by an ellipse, and those ellipses are
connected with an ellipse.

c. Multivalued Attribute
An attribute can have more than one value. These attributes are known as a
multivalued attribute. The double oval is used to represent multivalued attribute.
For example, a student can have more than one phone number.
d. Derived Attribute
An attribute that can be derived from other attribute is known as a derived attribute.
It can be represented by a dashed ellipse.
For example, A person's age changes over time and can be derived from another
attribute like Date of birth.

3. Relationship
A relationship is used to describe the relation between entities. Diamond or rhombus
is used to represent the relationship.

Types of relationship are as follows:


a. One-to-One Relationship
When only one instance of an entity is associated with the relationship, then it is
known as one to one relationship.
For example, A female can marry to one male, and a male can marry to one female.

b. One-to-many relationship
When only one instance of the entity on the left, and more than one instance of an
entity on the right associates with the relationship then this is known as a one-to-
many relationship.
For example, Scientist can invent many inventions, but the invention is done by the
only specific scientist.

c. Many-to-one relationship
When more than one instance of the entity on the left, and only one instance of an
entity on the right associates with the relationship then it is known as a many-to-one
relationship.
For example, Student enrolls for only one course, but a course can have many
students.

d. Many-to-many relationship
When more than one instance of the entity on the left, and more than one instance
of an entity on the right associates with the relationship then it is known as a many-
to-many relationship.
For example, Employee can assign by many projects and project can have many
employees.

Fig: Notations of ER diagram

15. What is a weak entity? Explain with example?


Weak Entity
An entity that depends on another entity called a weak entity. The weak entity
doesn't contain any key attribute of its own. The weak entity is represented by a
double rectangle.
16. Differentiate between DBMS and RDBMS.
Database Management System (DBMS) is a software that is used to define, create
and maintain a database and provides controlled access to the data. 
Relational Database Management System (RDBMS) is an advanced version of a
DBMS. 
 

DBMS RDBMS

DBMS stores data as file. RDBMS stores data in tabular form.

Data elements need to access Multiple data elements can be accessed


individually. at the same time.

Data is stored in the form of tables


No relationship between data. which are related to each other.

Normalization is not present. Normalization is present.

DBMS does not support


distributed database. RDBMS supports distributed database.

It uses a tabular structure where the


It stores data in either a headers are the column names, and the
navigational or hierarchical form. rows contain corresponding values.

It deals with small quantity of It deals with large amount of data.


DBMS RDBMS

data.

Data redundancy is common in Keys and indexes do not allow Data


this model. redundancy.

It is used for small organization It is used to handle large amount of


and deal with small data. data.

It supports single user. It supports multiple users.

Data fetching is slower for the Data fetching is fast because of


large amount of data. relational approach.

The data in a DBMS is subject to


low security levels with regards There exists multiple levels of data
to data manipulation. security in a RDBMS.

Low software and hardware Higher software and hardware


necessities. necessities.

Examples: XML, Window Examples: MySQL, PostgreSQL, SQL


Registry, etc. Server, Oracle, Microsoft Access etc.

17. Explain the term cardinality ratio with an example


In ER model, a relationship is an association among entities (records) of one or more
entity sets. Cardinality ratio or mapping cardinalities is a concept that describes
binary relationship set (a relationship that connects two entity sets) and its types. It
is about the maximum number of entities of one entity set that are associated with
the maximum number of entities of the other entity set.
For example, let us assume an entity set Department (to model information about
departments) and courses entity set (to model the courses that are offered by a
department). To establish a link (relationship) between these two entity sets we
need to define the number of entities (records) of department that are associated
with number of entities (records) of courses. As per our design requirement, if a
Department can offer many courses and a course can only be offered by at most one
department, then the relationship between department and courses is a one-to-
many relationship from department to courses (or the cardinality ratio between
department and courses is one-to-many).
See the example shown in the ERD below; [arrow head side - one side, without
arrow – many side]

One-to-many relationship OFFERS from entity Department to Courses

Long Answer Type Questions


18. Explain three-tier architecture of DBMS?

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.
Fig: 2-tier Architecture
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.
Fig: 3-tier Architecture

19. Explain about Database languages with examples?


Database Language
o A DBMS has appropriate languages and interfaces to express database queries and
updates.
o Database languages can be used to read, store and update the data in the database.
Types of Database Language
1. Data Definition Language
o DDL stands for Data Definition Language. It is used to define database structure or
pattern.
o It is used to create schema, tables, indexes, constraints, etc. in the database.
o Using the DDL statements, you can create the skeleton of the database.
o Data definition language is used to store the information of metadata like the
number of tables and schemas, their names, indexes, columns in each table,
constraints, etc.
Here are some tasks that come under DDL:
o Create: It is used to create objects in the database.
o Alter: It is used to alter the structure of the database.
o Drop: It is used to delete objects from the database.
o Truncate: It is used to remove all records from a table.
o Rename: It is used to rename an object.
o Comment: It is used to comment on the data dictionary.
These commands are used to update the database schema that's why they come
under Data definition language.
2. Data Manipulation Language
DML stands for Data Manipulation Language. It is used for accessing and
manipulating data in a database. It handles user requests.
Here are some tasks that come under DML:
Features of Java - Javatpoint
o Select: It is used to retrieve data from a database.
o Insert: It is used to insert data into a table.
o Update: It is used to update existing data within a table.
o Delete: It is used to delete all records from a table.
o Merge: It performs UPSERT operation, i.e., insert or update operations.
o Call: It is used to call a structured query language or a Java subprogram.
o Explain Plan: It has the parameter of explaining data.
o Lock Table: It controls concurrency.
3. Data Control Language
o DCL stands for Data Control Language. It is used to retrieve the stored or saved data.
o The DCL execution is transactional. It also has rollback parameters.
(But in Oracle database, the execution of data control language does not have the
feature of rolling back.)
Here are some tasks that come under DCL:
o Grant: It is used to give user access privileges to a database.
o Revoke: It is used to take back permissions from the user.
There are the following operations which have the authorization of Revoke:
CONNECT, INSERT, USAGE, EXECUTE, DELETE, UPDATE and SELECT.
4. Transaction Control Language
TCL is used to run the changes made by the DML statement. TCL can be grouped into
a logical transaction.
Here are some tasks that come under TCL:
o Commit: It is used to save the transaction on the database.
o Rollback: It is used to restore the database to original since the last Commit.

20. Write about logical database design (ER to Relational) with suitable examples?

ER Model, when conceptualized into diagrams, gives a good overview of entity-


relationship, which is easier to understand. ER diagrams can be mapped to relational
schema, that is, it is possible to create relational schema using ER diagram. We
cannot import all the ER constraints into relational model, but an approximate
schema can be generated.
There are several processes and algorithms available to convert ER Diagrams into
Relational Schema. Some of them are automated and some of them are manual. We
may focus here on the mapping diagram contents to relational basics.
ER diagrams mainly comprise of −
 Entity and its attributes
 Relationship, which is association among entities.
Mapping Entity
An entity is a real-world object with some attributes.

Mapping Process (Algorithm)


 Create table for each entity.
 Entity's attributes should become fields of tables with their respective data types.
 Declare primary key.
Mapping Relationship
A relationship is an association among entities.

Mapping Process
 Create table for a relationship.
 Add the primary keys of all participating Entities as fields of table with their
respective data types.
 If relationship has any attribute, add each attribute as field of table.
 Declare a primary key composing all the primary keys of participating entities.
 Declare all foreign key constraints.
Mapping Weak Entity Sets
A weak entity set is one which does not have any primary key associated with it.
Mapping Process
 Create table for weak entity set.
 Add all its attributes to table as field.
 Add the primary key of identifying entity set.
 Declare all foreign key constraints.
Mapping Hierarchical Entities
ER specialization or generalization comes in the form of hierarchical entity sets.

Mapping Process
 Create tables for all higher-level entities.
 Create tables for lower-level entities.
 Add primary keys of higher-level entities in the table of lower-level entities.
 In lower-level tables, add all other attributes of lower-level entities.
 Declare primary key of higher-level table and the primary key for lower-level table.
 Declare foreign key constraints.

You might also like