You are on page 1of 9

Department of Computer science and Engineering

COMPREHENSIVE VIVA-VOCE
DATABASE MANAGEMENT SYSTEM

Presented by Guided by
MURALIDHARAN M Mrs.I.Varalakshmi,
, CSE - B
M.tech.,
Assistant professor Dept.
of CSE
QUERY PROCESSING

It refers to the range of OPTIMIZATION


activities involved in
extracting data from a It is used for accessing the
database. database in an efficient
It translate the queries in manner.
high-level database It is based on selecting the
languages into low-level efficient query-evaluation
languages. plan from among the many
strategies.
PROCESSING OF QUERY
The steps involved in processing a query are
1. Parsing and translation
2. Optimization
3. Evaluation
FLOW CHART
EXAMPLE
In SQL, a user wants to fetch the records of the employees whose
salary is greater than or equal to 10000.
select emp_name from Employee where salary>10000;
σsalary>10000 (πsalary (Employee))
πsalary (σsalary>10000 (Employee))
QUESTIONS
1.What is SQL Query Optimization?
Query Optimization is the process of writing the query in a way that it
could execute quickly. It is a significant step for any standard
application.

2. What are some tips to improve the performance of SQL queries


Prefer to use views and stored procedures in spite of writing long
queries.
It’s better to introduce constraints instead of triggers.
Prevent the usage of DISTINCT and HAVING clauses.

3.What is an “explain” plan?


Ans. It’s a term used in Oracle. And it is a type of SQL clause in Oracle
that displays the execution plan that its optimizer plans for executing the
SELECT/UPDATE/INSERT/DELETE statements.

4. How do you tune a query using the “explain” plan?


Ans. The “explain” plan shows a complete output of the query costs
including each subquery. The cost is directly proportional to the query
execution time.
5. What are the factors to consider for creating an Index on the Table? Also, How to
select a column for Index?
Ans. The creation of an index depends on the following factors.
1. Size of the table,
2. Volume of data

6.Explain what the main components of a relational database are and how they
interact with each other?
The main components of a relational database are the tables, which store the data,
and the relations, which define the relationships between the data in the tables. The
relations are typically defined using foreign keys, which are used to link data in one
table to data in another table

7.Can you explain why we need to normalize data?


Normalization is the process of organizing data in a database so that it meets certain
requirements, in order to reduce redundancy and improve data integrity.

8. What are some typical ways that the optimizer decides which query plan it should
use?
The optimizer typically looks at the cost of each query plan and chooses the one that
is cheapest.
9. What is dynamic programming?
Dynamic programming is a technique for solving problems by breaking them down
into smaller subproblems, solving each of those subproblems only once, and storing
the solutions to each subproblem so that they can be reused later

10.What’s the difference between serialization and deserialization?


Serialization is the process of converting data into a format that can be stored or
transmitted. Deserialization is the process of converting data back into its original
form.

11.What is the first thing you would do when diagnosing performance issues on a new
project?
The first thing I would do when diagnosing performance issues on a new project is to
take a look at the query execution plan. This will give me a good idea of where the
bottlenecks are in the system and where I need to focus my optimization efforts.

12.What techniques can be used to improve the performance of a Stored Procedure?


-Using bind variables to avoid hard parsing
-Using indexes to improve query performance
-Using materialized views to improve query performance
-Using partitioning to improve query performance
13.Can you explain what an execution plan means?
An execution plan is the set of steps that the database server will take in order to
execute a SQL query. The execution plan will take into account the structure of the
data, the indexes that are available, and the way that the query is written in order to
determine the most efficient way to execute it.

14.Can you explain what a deadlock is?


A deadlock is a situation where two or more processes are each waiting for the other
to release a resource before they can continue. This can lead to a situation where the
processes are effectively locked in a stalemate, unable to continue.

You might also like