0% found this document useful (0 votes)
154 views14 pages

DBMS Viva Questions Aeraxia - in

The document discusses various database management system concepts including what a DBMS is, the different levels of data abstraction, data definition and data manipulation languages, database users, keys, relationships and joins. It also covers database objects like tables, views and triggers as well as SQL commands to work with databases.

Uploaded by

shubhpatil1313
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)
154 views14 pages

DBMS Viva Questions Aeraxia - in

The document discusses various database management system concepts including what a DBMS is, the different levels of data abstraction, data definition and data manipulation languages, database users, keys, relationships and joins. It also covers database objects like tables, views and triggers as well as SQL commands to work with databases.

Uploaded by

shubhpatil1313
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/ 14

DBMS VIVA Questions

What is DBMS?
Database management system is a collection of interrelated data and a set of
programs to access those data. Collection of data is referred to as a database.

What is database?
A database is an organized collection of data. The data are typically organized to
model

What is data Abstraction?


Since database system users are not computer trained, developers hide the
complexity from users through 3 levels of abstraction, to simplify user’s interaction
with the system. Is known as abstraction

What is DML Compiler?

It translates DML statements in a query language into low-level instruction that the
query evaluation engine can understand.

What is Query evaluation engine?

It executes low-level instruction generated by compiler.

What is DDL Interpreter?

It interprets DDL statements and record them in tables containing metadata.

What is Relationship set?

The collection (or set) of similar relationships.

What is Relationship type?

Relationship type defines a set of associations or a relationship set among a given


set of entity types.

What is degree of Relationship type?

It is the number of entity type participating.


What is degree of a Relation?

It is the number of attribute of its relation schema

What are the roles of DBA?

Schema definition: DBA creates database schema by executing Data


Definition Language (DDL) statements.
Storage structure and access method definition
Schema and physical organization modification: If any changes are to be
made in the original schema, to fit the need of your organization, then these
changes are carried out by the DBA.
Granting of authorization foe data access: DBA can decide which parts of
data can be accessed by which users.
Routine maintenance: DBA has to take periodic backups of the database,
ensure that enough disk space is available to store new data, ensure that
performance of dbms ix not degraded by any operation carried out by the
users.

What is data independence?


We can define two types of data independence

Logical data independence: It is the capacity to change the conceptual


schema without having to change external schemas or application
programs.

Physical data independence: It is the capacity to change the internal


schema without having to change the conceptual (or external) schemas.

What is Attributes?
Each entity has attributes—the particular properties that describe it.
For example, an employee entity may be described by the employee’s name, age,
address, salary, and job.

What are the levels of abstraction?

Physical level of data abstraction: This s the lowest level of abstraction which
describes how data are actually stored.

Logical level of data abstraction: This level hides what data are actually stored in
the database and what relationship exists among them.

View Level of data abstraction: View provides security mechanism to prevent


user from accessing certain parts of database.
What are data models ?

A data model is a collection of concepts that can be used to describe the structure
of a database. Data models can be broadly distinguished into 3 main categories-

High-level or conceptual data models (based on entities & relationships) It


provides concepts that are close to the way many users perceive data.

Low-level or physical data models It provides concepts that describe the details
of how data is stored in the computer. These concepts are meant for computer
specialist, not for typical end users.

Representational or implementation data models (record-based,object-oriented)

What are the different types of database users?

Naive users:
These are the unsophisticated users who interact with the system by invoking
one of the application programs that have been written previously.

Application programmers:
These are computer professionals who write application programs, used to
develop user interfaces.

Sophisticated users:
These users interact with the database using database query language. They submit
their query to the query processor.

Specialized users:
These users write specialized database applications to retrieve data. These
applications can be used to retrieve data with complex data types

Who is database administrator (DBA)?


A person having who has central control over data and programs that access the data
is called DBA

What is hierarchical data model


In this model, each record in the database represented a specific part. The records
had parent/child relationships, linking each part to its subpart, and so on.
What is network data model
The network data model extended the hierarchical model by allowing a record to
participate in multiple parent/child relationships.

What is Entity?
The basic object that the ER model represents is an entity, which is a “thing” in the
real world with an independent existence.

What is Keys?
An important constraint on the entities of an entity type is the key or uniqueness
constraint on attributes. A key is an attribute (also known as column or field) or a
combination of attribute that is used to identify records.

What are the types of Key?


Super Key – An attribute or a combination of attribute that is used to identify the
records uniquely is known as Super Key. A table can have many Super Keys.

Candidate Key – It can be defined as minimal Super Key or irreducible Super Key.
In other words an attribute or a combination of attribute that identifies the record
uniquely but none of its proper subsets can identify the records uniquely.

Primary Key – A Candidate Key that is used by the database designer for
unique identification of each row in a table is known as Primary Key

Foreign Key – A foreign key is an attribute or combination of attribute in one


base table that points to the candidate key (generally it is the primary key) of
another table.

Composite Key – If we use multiple attributes to create a Primary Key then that
Primary Key is called Composite Key

Alternate Key – Alternate Key can be any of the Candidate Keys except for the
Primary Key.
Secondary Key – The attributes that are not even the Super Key but can be still
used for identification of records (not unique) are known as Secondary Key.

Difference between TRUNCATE, DELETE and DROP commands

The DELETE command is used to remove rows from a table. A WHERE clause
can be used to only remove some rows. If no WHERE condition is specified, all
rows will be removed.
TRUNCATE removes all rows from a table. The operation cannot be rolled back
and no triggers will be fired. As such, TRUCATE is faster and doesn’t use as much
undo space as a DELETE.
The DROP command removes a table from the database. All the tables’ rows,
indexes and privileges will also be removed. No DML triggers will be fired. The
operation cannot be rolled back.
DROP and TRUNCATE are DDL commands, whereas DELETE is a DML command.
Therefore DELETE operations can be rolled back (undone), while DROP and
TRUNCATE operations cannot be rolled back.

What is cardinalities?
Mapping cardinalities, or cardinality ratios, express the number of entities to which
another entity can be associated via a relationship set There are three types of
relationships
One to one
One to many
Many to many

What is Participation?
The participation of an entity set E in a relationship set R is said to be total if
every entity in E participates in at least one\ relationship in R.
If only some entities in E participate in relationships in R, the participation of
entity set E in relationship R is said to be partial.

What is Weak Entities?


An entity set may not have sufficient attributes to form a primary key. Such an entity
set is termed a weak entity set.

What is Weak Entities?


An entity set having sufficient attributes to form a primary key. Such an entity set is
termed a Strong entity set.

What is Specialization
The process of designating sub groupings within an entity set is called
specialization.
For example, customer entities may be described further by the attribute
customer-id, whereas employee entities may be described further by the
attributes employee-id and salary.

What is Generalization
Generalization defines a is-a-kind of relationship in which one class shares its
structure and/or behavior with one or more other classes.
how to drop a table?

DROP TABLE CUSTOMER

What is View?
A view is a “virtual table” in the database whose contents are defined by a query.

Advantages of VIEW?
Security, Query simplicity, Structural simplicity, Insulation from change, Data integrity

Disadvantages of VIEW?
Performance issue, Update restrictions

What are different DDL commands?


Create, drop, and alter

What are different DDL commands?


Select, insert, update, delete

What is Joins?
The process of forming pairs of rows by matching the contents of related
columns is called joining the tables.

How to Create Table?

Create table account (account-number char(10), balance integer)

What is Aggregation

Aggregation represents abstract entities by allowing relationship between


relationships. As you work with ER Diagrams you will come across the need for
certain type of entities that are overlapping. For example, an ‘Employee’ ‘works-
on’ a ‘branch’. An ‘Employee’ ‘manages’ some tasks. The ‘Works-on’ entity here
can be abstracted via the use of aggregation. This is represented in a ER diagram
by a diamond shape.
What are the types of Joins?

INNER JOIN
Inner join shows matches only when they exist in both tables.

LEFT OUTER JOIN


Left join will display all records in left table of the SQL statement.

RIGHT OUTER JOIN


Right join will display all records in right table of the SQL statement.

What is trigger
The concept of a trigger is relatively straightforward. For any event that causes a change
in the contents of a table, a user can specify an associated action that the DBMS should
carry out. The three events that can trigger an action are attempts to INSERT, DELETE,
or UPDATE rows of the table.

What are the different types of storage?


Primary storage: This category includes storage media that can be operated on directly
by the computer central processing unit (CPU), such as the computer main memory and
smaller but faster cache memories.
Secondary storage: This category includes magnetic disks, optical disks, and tapes.
These devices usually have a larger capacity, cost less, and provide slower access to
data than do primary storage devices.

What is Lossless join property?

It guarantees that the spurious tuple generation does not occur with respect to relation
schemas after decomposition.

What is normalization?

It is a process of analysing the given relation schemas based on their Functional


Dependencies (FDs) and primary key to achieve the properties
(1).Minimizing redundancy, (2). Minimizing insertion, deletion and update anomalies.

What is Object Oriented model?

This model is based on collection of objects. An object contains values stored in instance
variables with in the object. An object also contains bodies of code that operate on the
object. These bodies of code are called methods. Objects that contain same types of
values and the same methods are grouped together into classes.
What are stand-alone procedures?

Procedures that are not part of a package are known as stand-alone because they
independently defined. A good example of a stand-alone procedure is one written in a
SQL*Forms application. These types of procedures are not available for reference from
other Oracle tools. Another limitation of stand-alone procedures is that they are
compiled at run time, which slows execution.

What is indexing?
A database index is a data structure that improves the speed of data retrieval operations
on a database table at the cost of slower writes and increased storage space. Indices can
be created using one or more columns of a database table, providing the basis for both
rapid random lookups and efficient access of ordered records.

What is Tree Structured Indexing?


The data entries are arranged in sorted order by search key value, and a hierarchical
search data structure is maintained that directs searches to the correct page of data
entries.

What is Hash Based indexing?


We can organize records using a technique called hashing to quickly find records that
have a given search key value. For example, if the file of employee records is hashed on
the name field, we can retrieve all records about Joe. In this approach, the records in a
file are grouped in buckets, where a bucket consists of a primary page and, possibly,
additional pages linked in a chain. The bucket to which a record belongs can be
determined by Applying a special function, called a hash function, to the search key.
Given a bucket number, a hash-based index structure allows us to retrieve the primary
page for the bucket in one or two disk l/Os. On inserts, the record is inserted into the
appropriate bucket, with ‘overflow’ pages allocated as necessary.

What is Functional dependency?

Functional dependency describes the relationship between attributes in a relation.


For example, if A and B are attributes of relation R, and B is functionally dependent
on A ( denoted A B), if each value of A is associated with exactly one value of B. ( A
and B may each consist of one or more attributes.)
Explain 1NF,2NF,3NF?
Normalization is the process of successively reducing relations with anomalies to
produce smaller and well structured relations.

First normal form (1NF) is a relation that has a primary key and in which there
are no repeating groups.

Second normal form (2NF) a relation in first normal form in which every non key
attribute is fully functionally dependent on the primary key.

Third normal form (3NF)a relation that is in second normal form and has no transitive
dependencies.

What is BCNF?

Boyce-Codd normal form (or BCNF or 3.5NF) is a normal form used in database
normalization. It is a slightly stronger version of the third normal form (3NF). A table
is in Boyce-Codd normal form if and only if for every one of its non-trivial
[dependencies] X → Y, X is a superkey—that is, X is either a candidate key or a
superset thereof.

Compare 3NF & BCNF


Boyce Codd normal form (also known as BCNF) is a normal form –that is a form
that provides criteria for determining a table’s degree of vulnerability to logical
inconsistencies and anomalies. 3NF is a normal form that is also used in database
normalisation. It is thought that a table is in 3NF if and only if 1) the table is in
second normal form (or 2NF, which is a first normal code, or 1NF, that has met the
criteria to become a 2NF), and 2) every non-prime attribute of the table is non-
transitively dependent on
every key of the table (meaning it is not directly dependent on every key). There is
another postulation of 3NF that is also used to define the differences between 3NF
and the BCNF.
What is Transaction?
A transaction is a collection of operations that performs a single logical function
in a database application

What is Recovery? What are its techniques?


Process of restoring database to a correct state in the event of a failure. The Recovery
techniques are as follows:

Deferred Update
Updates are not written to the database until after a transaction has reached its
commit point.

Immediate Update
Updates are applied to database as they occur.
Need to redo updates of committed transactions following a failure.

Shadow Paging.
Maintain two page tables during life of a transaction: current page and shadow
page table.
When transaction starts, two pages are the same.
Shadow page table is never changed thereafter and is used to restore database in
event of failure.

What is locking? Explain locking techniques.


DBMS products use sophisticated locking techniques to handle concurrent SQL
transactions for many simultaneous users. A shared lock is used by the DBMS when a
transaction wants to read data from the database. Another concurrent transaction
can also acquire a shared lock on the same data, allowing the other transaction to
also read the data. An exclusive lock is used by the DBMS when a transaction wants
to update data in the database. When a transaction has an exclusive lock on some
data, other transactions cannot acquire any type of lock (shared or exclusive) on the
data.

What is deadlock? Its Prevention & Avoidance?


A deadlock is a situation wherein two or more competing actions are each
waiting for the other to finish, and thus neither ever does.

What is two phase locking?


According to the two-phase locking protocol, a transaction handles its locks in
two distinct, consecutive phases during the transaction's execution:

Expanding phase (number of locks can only increase): locks Care acquired and
no locks are released.
Shrinking phase: locks are released and no locks are acquired.
What is GRANT privileges?

The GRANT statement is used to grant the privileges on the database objects to
specific users. Normally the GRANT statement is used by owner of the table or
view to give other users access to the data. The GRANT statement includes list of
the privileges to be granted, name of the table to which privileges apply and user id
to which privileges are granted.

E.g. 1) Give user ABC full access to employee table:


GRANT Select, Insert, Delete, update on employee to ABC

What is REVOKE privileges?

In most SQL based databases, the privileges that you have granted with the
GRANT statement can be taken away with the REVOKE statement. The
structure of the REVOKE statement is much similar to that of the GRANT
statement. A REVOKE statement may take away all or some of the privileges
granted to a user id.

E.g. Revoke Select, Insert on employee from ABC.

What is Serializability?

In concurrency control of databases, transaction processing (transaction


management), and various transactional applications, both centralized and
distributed, a transaction schedule is serializable, has the Serializability property, if
its outcome (the resulting database state, the values of the database's data) is equal
to the outcome of its transactions executed serially, i.e., sequentially without
overlapping in time.

What are Locking parameters?

Lock size, Number of locks, Lock timeout

what are levels of Locking?


Database level locking: Locking can be implemented at various levels of the
Database. In its crudest form, the DBMS could lock the entire database for each
transaction.

Page level locking:


Many DBMS products implement locking at the page level. In this scheme, the
DBMS locks individual blocks of data ("pages") from the disk as they are accessed
by a transaction.

Row level locking:


Over the last several years, most of the major commercial DBMS systems have
moved beyond page-level locking to row-level locks.
What is Authorization and Integrity manager?

It is the program module, which tests for the satisfaction of integrity constraint
and checks the authority of user to access data.

What are cursors give different types of cursors?

PL/SQL uses cursors for all database information accesses statements. The language
supports the use two types of cursors
Implicit
Explicit

What are stored-procedures? And what are the advantages of using


them?

Stored procedures are database objects that perform a user defined operation. A
stored procedure can have a set of compound SQL statements. A stored procedure
executes the SQL commands and returns the result to the client.
Stored procedures are used to reduce network traffic.

How do you communicate with an RDBMS?

You communicate with an RDBMS using Structured Query Language (SQL).

Name the sub-systems of a RDBMS.

I/O, Security, Language Processing, Process Control, Storage Management, Logging


and Recovery, Distribution Control, Transaction Control, Memory Management,
Lock Management.

What is a query?

A query with respect to DBMS relates to user commands that are used to interact
with a data base. The query language can be classified into data definition language
and data manipulation language.
What do you mean by Correlated subquery?

Subqueries, or nested queries, are used to bring back a set of rows to be used by
the parent query. Depending on how the subquery is written, it can be executed
once for the parent query or it can be executed once for each row returned by the
parent query. If the subquery is executed for each row of the parent, this is called a
correlated subquery.

A correlated subquery can be easily identified if it contains any references to the


parent subquery columns in its WHERE clause. Columns from the subquery cannot
be referenced anywhere else in the parent query. The following example
demonstrates a non-correlated subquery.

Example: Select * From CUST Where '10/03/1990' IN (Select ODATE From ORDER
Where CUST.CNUM = ORDER.CNUM)

What is meant by query optimization?

The phase that identifies an efficient execution plan for evaluating a query that has
the least estimated cost is referred to as query optimization.

What is durability in DBMS?

Once the DBMS informs the user that a transaction has successfully completed, its
effects should persist even if the system crashes before all its changes are reflected
on disk. This property is called durability.

What do you mean by atomicity and aggregation?

Atomicity: Either all actions are carried out or none are. Users should not have
to worry about the effect of incomplete transactions. DBMS ensures this by
undoing the actions of incomplete transactions.
Aggregation: A concept which is used to model a relationship between a
collection of entities and relationships. It is used when we need to express a
relationship among relationships.

What is a Phantom Deadlock?

In distributed deadlock detection, the delay in propagating local information might


cause the deadlock detection algorithms to identify deadlocks that do not really
exist. Such situations are called phantom deadlocks and they lead to unnecessary
aborts.
What are the different phases of transaction?

Different phases are


Analysis phase,
Redo Phase,
Undo phase.

What is 4NF?

A relation schema R is said to be in 4NF if for every Multivalued dependency X Y that


holds over R, one of following is true.
X is subset or equal to (or) XY = R.
X is a super key.

What is 5NF?

A Relation schema R is said to be 5NF if for every join dependency {R1, R2, ..., Rn}
that holds R, one the following is true 1.) Ri = R for some i.
2.) The join dependency is implied by the set of FD, over R in which the left side is
key of R.

What is Domain-Key Normal Form?

A relation is said to be in DKNF if all constraints and dependencies that should hold
on the the constraint can be enforced by simply enforcing the domain constraint
and key constraint on the relation.

What is indexing and what are the different kinds of indexing?

Indexing is a technique for determining how quickly specific data can be found.
Types:

Binary search style indexing


B-Tree indexing
Inverted list indexing
Memory resident table
Table indexing

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy