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

DBMS Answers Question Bank Ch01 PDF

The document discusses the role and responsibilities of a database administrator (DBA). It states that a DBA decides on hardware, manages data integrity and security, controls database accessibility and permissions, designs databases both logically and physically, implements databases, enhances query performance, and tunes databases to improve performance.

Uploaded by

Pranay Chalumuri
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)
82 views

DBMS Answers Question Bank Ch01 PDF

The document discusses the role and responsibilities of a database administrator (DBA). It states that a DBA decides on hardware, manages data integrity and security, controls database accessibility and permissions, designs databases both logically and physically, implements databases, enhances query performance, and tunes databases to improve performance.

Uploaded by

Pranay Chalumuri
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/ 17

1)Write about the role of Database Administrator?

Role and Duties of Database Administrator (DBA) :


 Decides hardware –
They decide on economical hardware, based on cost, performance, and
efficiency of hardware, and best suits the organization. It is hardware that is an
interface between end users and the database.
 Manages data integrity and security –
Data integrity needs to be checked and managed accurately as it protects and
restricts data from unauthorized use. DBA eyes on relationships within data to
maintain data integrity.
 Database Accessibility –
Database Administrator is solely responsible for giving permission to access
data available in the database. It also makes sure who has the right to change
the content.
 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 the time of its
implementation.
 Query processing performance –
DBA enhances query processing by improving speed, performance, and
accuracy.
 Tuning Database Performance –
If the user is not able to get data speedily and accurately then it may lose
organization’s business. So by tuning SQL commands DBA can enhance the
performance of the database.
2) Illustrate weak and strong entity with suitable examples?

Strong Entity:
A strong entity is not dependent on any other entity in the schema. A strong entity
will always have a primary key. Strong entities are represented by a single
rectangle. The relationship of two strong entities is represented by a single
diamond.

Examples for the strong entity



o Consider the ER diagram which consists of two entities student and
course
o Student entity is a strong entity because it consists of a primary
key called student id which is enough for accessing each record
uniquely
o In the same way, the course entity contains of course ID attribute
which is capable of uniquely accessing each row.

Weak Entity:
A weak entity is dependent on a strong entity to ensure its existence. Unlike a
strong entity, a weak entity does not have any primary key. It instead has a partial
discriminator key. A weak entity is represented by a double rectangle.
The relation between one strong and one weak entity is represented by a double
diamond. This relationship is also known as identifying relationship.

Example : A loan entity can not be created for a customer if the customer doesn’t
exist

o A double rectangle is used for representing a weak entity set


o The double diamond symbol is used for representing
the relationship between a strong entity and a weak entity which is
known as identifying relationship

3) Write the difference between 2-tier and 3-tier architecture.

Parameters Two-Tier Database Three-Tier Database Architecture


Architecture

Meaning and The two-tier DB architecture is a The three-tier DB architecture is a


Purpose client-server architecture. type of web-based application.

Number of It contains mainly two layers- It mainly contains three layers- the
Layers the Data Tier (Database Tier), Data Layer, the Business Layer, and
and the Client Tier. the Client Layer.

Location of A two-tier DB architecture A three-tier DB architecture buries


Application either buries the application the process or application logic in
Logic logic within the server database, the middle-tier. Thus, it acts as a
on the client (inside the UI), or separate entity from the Client/ User
both of them. Interface and the data Interface.

Building and A two-tier DB architecture is A three-tier DB architecture is


Maintenance comparatively much easier to comparatively much complex to
maintain as well as build. maintain as well as build.

Speed of It runs at a comparatively slower It runs and works at a comparatively


Operation pace. faster pace.

Security The two-tier DB architecture The three-tier DB architecture does


allows the client to communicate not allow its clients and database to
directly with the database- thus communicate directly- thus making
making it less secure. it comparatively more secure in the
long run.

Loss of The two-tier DB architecture The three-tier DB architecture leads


Performance leads to a performance loss with to a performance loss when we
an increase in the number of happen to run a system over the
users. Internet. Yet, it exhibits an overall
better performance as compared to
its two-tier counterpart.

Examples A few examples of the two-tier A few examples of the three-tier


database architecture are the database architecture are a website
Railway Reservation System, on the Internet, the process of
Contact Management System designing registration forms with
that one can create with the MS- buttons, labels, text boxes, and
Access, etc. many more.

4) Write the difference between logical data independence and physical data
independence.
Physical Data Independence Logical Data Independence

It mainly concern about how the data It mainly concerned about the structure
is stored into the system. or the changing data definition.

It is difficult to retrieve because the


It is easy to retrieve. data is mainly dependent on the logical
structure of data.

As compared to the logical As compared to the physical


independence it is easy to achieve independence it is not easy to achieve
physical data independence. logical data independence.

Any change at the physical level, does


The change in the logical level requires
not require to change at the
a change at the application level.
application level.

The modifications made at the The modifications made at the logical


internal level may or may not be level is significant whenever the logical
needed to improve the performance of structure of the database is to be
the structure. changed.

It is concerned with the internal It is concerned with the conceptual


schema. schema.

Example: Change in compression


Example: Add/Modify or Delete a new
techniques, Hashing algorithms and
attribute.
storage devices etc.

5) Briefly explain the three schema architecture.?

3-SCHEMA ARCHITECTURE FOR DATA INDEPENDENCE / 3-LEVEL


ARCHITECTURE/ DATA ABSTRACTION:
The three-schema architecture divides the database into three-level used to create a
separation between the physical database and the user application. In simple terms,
this architecture hides the details of physical storage from the user. The database
administrator (DBA) responsible is to change the structure of database storage
without affecting the user’s view.
This architecture contains three layers of database management system, which are
as follows −
 External level
 Conceptual level
 Internal level
External/ View level
This is the highest level of database abstraction. It includes a number of external
schemas or user views. This level provides different views of the same database
for a specific user or a group of users. An external view provides a powerful and
flexible security mechanism by hiding the parts of the database from a particular
user.
Conceptual or Logical level
This level describes the structure of the whole database. It acts as a middle layer
between the physical storage and user view. It explains what data to be stored in
the database, what the data types are, and what relationship exists among those
data. There is only one conceptual schema per database.
Internal or Physical level
This is the lowest level of database abstraction. It describes how the data is stored
in the database and provides the methods to access data from the database. It
allows viewing the physical representation of the database on the computer
system.
The interface between the conceptual and internal schema identifies how an
element in the conceptual schema is stored and how it may be accessed.
6) What are the disadvantages of traditional file processing system? Explain with
example.(10 Marks)
File Processing System :
In Computer Science, File Processing System (FPS) is a way of storing,
retrieving and manipulating data which is present in various files.
Files are used to store various documents. All files are grouped based on their
categories. The file names are very related to each other and arranged properly to
easily access the files. In file processing system, if one needs to insert, delete,
modify, store or update data, one must know the entire hierarchy of the files.
Disadvantages of File Processing System :

1. Data redundancy and inconsistency.


Since different programmers create the files and application programs over a long
period, the various files are likely to have different formats and the programs may
be written in several programming languages. Moreover, the same information
may be duplicated in several places (files). In addition, it may lead to data
inconsistency; that is, the various copies of the same data may no longer agree.
2. Difficulty in accessing data.

Suppose that one of the bank officers needs to find out the names of all customers
who live within a particular postal-code area. The officer asks the data-processing
department to generate such a list. Because the designers of the original system did
not anticipate this request, there is no application program on hand to meet it. The
bank officer has now two choices: either obtain the list of all customers and extract
the needed information manually or ask a system programmer to write the
necessary application program. Both alternatives are obviously unsatisfactory.
The conventional file-processing environments do not allow needed data to be
retrieved in a convenient and efficient manner. More responsive data-retrieval
systems are required for general use.

3. Data isolation.

Because data are scattered in various files, and files may be in different formats,
writing new application programs to retrieve the appropriate data is difficult.

4. Integrity problems.

The data values stored in the database must satisfy certain types of consistency
constraints. For example, the balance of a bank account may never fall below a
prescribed amount (say, $25). Developers enforce these constraints in the system
by adding appropriate code in the various application programs. However, when
new constraints are added, it is difficult to change the programs to enforce them.
5. Atomicity problems.

A computer system, like any other mechanical or electrical device, is subject to


failure. In many applications, it is crucial that, if a failure occurs, the data be
restored to the consistent state that existed prior to the failure. It is difficult to
ensure atomicity in a conventional file-processing system.
6. Concurrent-access anomalies.

For the sake of overall performance of the system and faster response, many
systems allow multiple users to update the data simultaneously. In such an
environment, interaction of concurrent updates may result in inconsistent data.
7. Security problems.

Not every user of the database system should be able to access all the data. For
example, in a banking system, payroll personnel need to see only that part of the
database that has information about the various bank employees. They do not need
access to information about customer accounts.

7)Draw and explain E-R diagram for banking enterprise.(10 Marks)

The above ER diagram illustrates key information about bank, including entities
such as branches, customers, accounts, and loans. It allows us to understand the
relationships between entities.
Entities and their Attributes are :

 Bank Entity : Attributes of Bank Entity are Bank Name, Code and Address.
Code is Primary Key for Bank Entity.
 Customer Entity : Attributes of Customer Entity are Customer_id, Name,
Phone Number and Address.
Customer_id is Primary Key for Customer Entity.
 Branch Entity : Attributes of Branch Entity are Branch_id, Name and
Address.
Branch_id is Primary Key for Branch Entity.
 Account Entity : Attributes of Account Entity are Account_number,
Account_Type and Balance.
Account_number is Primary Key for Account Entity.
 Loan Entity : Attributes of Loan Entity are Loan_id, Loan_Type and
Amount.
Loan_id is Primary Key for Loan Entity.

Relationships are :

 Bank has Branches => 1 : N


One Bank can have many Branches but one Branch can not belong to many
Banks, so the relationship between Bank and Branch is one to many
relationship.

 Branch maintain Accounts => 1 : N


One Branch can have many Accounts but one Account can not belong to many
Branches, so the relationship between Branch and Account is one to many
relationship.

 Branch offer Loans => 1 : N


One Branch can have many Loans but one Loan can not belong to many
Branches, so the relationship between Branch and Loan is one to many
relationship.

 Account held by Customers => M : N


One Customer can have more than one Accounts and also One Account can be
held by one or more Customers, so the relationship between Account and
Customers is many to many relationship.

 Loan availed by Customer => M : N


(Assume loan can be jointly held by many Customers).
One Customer can have more than one Loans and also One Loan can be
availed by one or more Customers, so the relationship between Loan and
Customers is many to many relationship.
8) Explain different types of database users(10 M)
1. Database Administrators
Administering resources (database, DBMS and related software) is the
responsibility of the database administrator (DBA).
The DBA is responsible for Authorizing access to the database,Coordinating and
monitoring its use, Acquiring software and hardware resources as needed.
DBA repairs damage caused due to hardware and/or software failures.
DBA is the one having privileges to perform DCL (Data Control Language)
operations such as GRANT and REVOKE, to allow/restrict a particular user from
accessing the database.
The DBA is accountable for problems such as security cracks and poor system
response time.
2. Database Designers
Database designers are responsible for identifying the to be stored in the database
and for choosing appropriate to represent and store this data.
It is the responsibility of database designers to communicate with all prospective
database users in order to understand their requirements and to create a design that
meets these requirements.
In many cases, the designers are on the staff of the DBA and may be assigned other
staff responsibilities after the database design is completed. Database designers
typically interact with each potential group of users and develop of the database
that meet the data and processing requirements of these groups.
Each view is then analyzed and integrated with the views of other user groups. The
final database design must be capable of supporting the requirements of all user
groups.

3.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.

4.Application Programmers : Application Programmers also referred as System


Analysts or simply Software Engineers, 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. Application
programmers design, debug, test, and maintain set of programs called “canned
transactions” for the Naive (parametric) users in order to interact with database.
5. End Users
End users are the people whose jobs require access to the database for querying,
updating, and generating reports; the database primarily exists for their use. There
are several categories of end users:
i. Casual end users occasionally access the database, but they may need different
information each time. They use a sophisticated database query language to specify
their requests and are typically middle or high-level managers or other occasional
browsers.
ii. Naive or parametric end users make up a sizable portion of database end
users. Their main job function revolves around constantly querying and updating
the database, using standard types of queries and updates—called canned
transactions—that have been carefully programmed and tested. The tasks that such
users perform are varied:
Reservation agents for airlines, hotels, and car rental companies check
availability for a given request and make reservations.

Employees at receiving stations for shipping companies enter package


identifications via bar codes and descriptive information through buttons to update
a central database of received and in-transit packages.
iii. Sophisticated end users include engineers, scientists, business analysts, and
others who thoroughly familiarize themselves with the facilities of the DBMS in
order to implement their own applications to meet their complex requirements.
iv. Standalone users maintain personal databases by using ready-made program
packages that provide easy-to-use menu-based or graphics-based interfaces. An
example is the user of a tax package that stores a variety of personal financial data
for tax purposes.
9) With a neat sketch explain the DBMS system environment.(10 Marks)

THE DATABASE SYSTEM ENVIRONMENT:


Figure below illustrates, in a simplified form, the typical DBMS components. The
figure is divided into two parts. The top part of the figure refers to the various users
of the database environment and their interfaces. The lower part shows the
internals of the DBMS responsible for storage of data and processing of
transactions.
Let us consider the top part of Figure first. It shows interfaces for the DBA staff,
casual users who work with interactive interfaces to formulate queries, application
programmers who create programs using some host programming languages, and
parametric users who do data entry work by supplying parameters to predefined
transactions. The DBA staff works on defining the database and tuning it by
making changes to its definition using the DDL and other privileged commands.
The DDL compiler processes schema definitions, specified in the DDL, and stores
descriptions of the schemas (meta-data) in the DBMS catalog. The catalog includes
information such as the names and sizes of files, names and data types of data
items, storage details of each file, mapping information among schemas, and
constraints. In addition, the catalog stores many other types of information that are
needed by the DBMS modules, which can then look up the catalog information as
needed.
Casual users and persons with occasional need for information from the database
interact using some form of interface, which we call the interactive query interface
and so on by a query compiler that compiles them into an internal form. This
internal query is subjected to query optimization. Among other things, the query
optimizer is concerned with the rearrangement and possible reordering of
operations, elimination of redundancies, and use of correct algorithms and indexes
during execution. It consults the system catalog for statistical and other physical
information about the stored data and generates executable code that performs the
necessary operations for the query and makes calls on the runtime processor.
Application programmers write programs in host languages such as Java, C, or
C++ that are submitted to a precompiler. The precompiler extracts DML
commands from an application program written in a host programming language.
These commands are sent to the DML compiler for compilation into object code
for database access. The rest of the program is sent to the host language compiler.
The object codes for the DML commands and the rest of the program are linked,
forming a canned transaction whose executable code includes calls to the runtime
database processor. Canned transactions are executed.
repeatedly by parametric users, who simply supply the parameters to the
transactions. Each execution is considered to be a separate transaction. An example
is a bank withdrawal transaction where the account number and the amount may be
supplied as parameters.
In the lower part of Figure, the runtime database processor executes (1) the
privileged commands, (2) the executable query plans, and (3) the canned
transactions with runtime parameters. It works with the system catalog and may
update it with statistics. It also works with the stored data manager, which in turn
uses basic operating system services for carrying out low-level input/output
(read/write) operations between the disk and main memory. The runtime database
processor handles other aspects of data transfer, such as management of buffers in
the main memory. Some DBMSs have their own buffer management module while
others depend on the OS for buffer management. We have shown concurrency
control and backup and recovery systems separately as a module in this figure.
They are integrated into the working of the runtime database processor for
purposes of transaction management.
10) Draw an ER diagram for COMPANY database.( 10 Marks)
Chapater2
1) Illustrate the use of Between and IN operators in SQL.

The BETWEEN operator in SQL is used to retrieve data from a table within a
specific range of values. It is a logical operator that combines the >= (greater than
or equal to) and <= (less than or equal to) operators.

The syntax of the BETWEEN operator is as follows:

SELECT column_name(s)
FROM table_name
WHERE column_name BETWEEN value1 AND value2;

For example, we have a table called "Products" with columns "ProductID",


"ProductName", "UnitPrice", and "UnitsInStock". We can use the BETWEEN
operator to retrieve all products with a UnitPrice between $10 and $20, as follows:

SELECT ProductID, ProductName, UnitPrice, UnitsInStock


FROM Products
WHERE UnitPrice BETWEEN 10 AND 20;

IN Operator
The IN operator allows you to specify multiple values in a WHERE clause.

The IN operator is a shorthand for multiple OR conditions.

IN Syntax
SELECT column_name(s)
FROM table_name
WHERE column_name IN (value1, value2, ...);

The following SQL statement selects all customers that are located in "Germany",
"France" or "UK":

SELECT * FROM Customers


WHERE Country IN ('Germany', 'France', 'UK');

IN Operator in SUBQuery
The IN operator in SQL is used to check if a value matches any value in a list or a
subquery. It is a logical operator that can be used in the WHERE clause of a
SELECT statement.

SELECT column_name(s)
FROM table_name
WHERE column_name IN (SELECT STATEMENT);

The following SQL statement selects all customers that are from the same
countries as the suppliers:

SELECT * FROM Customers


WHERE Country IN (SELECT Country FROM Suppliers);

You might also like