top-50-database-interview-questions
top-50-database-interview-questions
com/
2) What is DBMS?
Database Management Systems (DBMS) are applications designed especially which enable
user interaction with other applications.
Data definition
Update
Retrieval
Administration
1 / 10
http://career.guru99.com/
A data model determining fundamentally how data can be stored, manipulated and organised
and the structure of the database logically is called database model.
9) What is SQL?
2 / 10
http://career.guru99.com/
Structured Query Language (SQL) being ANSI standard language updates database and
commands for accessing.
One-to-one: Single table having drawn relationship with another table having similar kind
of columns.
One-to-many: Two tables having primary and foreign key relation.
Many-to-many: Junction table having many tables related to many tables.
Organized data void of inconsistent dependency and redundancy within a database is called
normalization.
No duplicate entries
Saves storage space
Boasts the query performances.
Boosting up database performance, adding of redundant data which in turn helps rid of complex
data is called denormalization.
They are:
CREATE:
3 / 10
http://career.guru99.com/
ALTER:
DROP:
A database object which helps in manipulating data row by row representing a result set is
called cursor.
They are:
Implicit cursor: Declared automatically as soon as the execution of SQL takes place
without the awareness of the user.
Explicit cursor: Defined by PL/ SQL which handles query in more than one row.
4 / 10
http://career.guru99.com/
Both having B-tree structure, non-clustered index has data pointers enabling one table many
non-clustered indexes while clustered index is distinct for every table.
Functions which operate against a collection of values and returning single value is called
aggregate functions
Scalar function is depended on the argument given and returns sole value.
25) What restrictions can you apply when you are creating views?
A ‘correlated subquery’ is a sort of sub query but correlated subquery is reliant on another
query for a value that is returned. In case of execution, the sub query is executed first and then
the correlated query.
Storage and access of data from the central location in order to take some strategic decision is
called Data Warehousing. Enterprise management is used for managing the information whose
framework is known as Data Warehousing.
Joins help in explaining the relation between different tables. They also enable you to select
data with relation to data in another table.
5 / 10
http://career.guru99.com/
INNER JOINs: Blank rows are left in the middle while more than equal to two tables are
joined.
OUTER JOINs: Divided into Left Outer Join and Right Outer Join. Blank rows are left at
the specified side by joining tables in other side.
Other joins are CROSS JOINs, NATURAL JOINs, EQUI JOIN and NON-EQUI JOIN.
Indexes help in improving the speed as well as the query performance of database. The
procedure of boosting the collection of indexes is named as Index hunting.
Index hunting helps in improving the speed as well as the query performance of database. The
followed measures are achieved to do that:
The query optimizer is used to coordinate the study of queries with the workload and the
best use of queries suggested based on this.
Index, query distribution along with their performance is observed to check the effect.
Tuning databases to a small collection of problem queries is also recommended.
No indexes
Stored procedures are excessively compiled.
Triggers and procedures are without SET NOCOUNT ON.
Complicated joins making up inadequately written query.
Cursors and temporary tables showcase a bad presentation.
6 / 10
http://career.guru99.com/
SQL Server caches collected procedure or the plan of query execution and used
thereafter by subsequent calls.
An important feature in relation to performance enhancement.
Data execution plan can be viewed textually or graphically.
A data structure in the form of tree which stores sorted data and searches, insertions,
sequential access and deletions are allowed in logarithmic time.
Iterating over all the table rows is called Table Scan while iterating over all the index items is
defined as Index Scan.
36) What do you mean by Fill Factor concept with respect to indexes?
Fill Factor can be defined as being that value which defines the percentage of left space on
every leaf-level page that is to be packed with data. 100 is the default value of Fill Factor.
Fragmentation can be defined as a database feature of server that promotes control on data
which is stored at table level by the user.
An outer loop within an inner loop is formed consisting of fewer entries and then for individual
entry, inner loop is individually processed.
E.g.
7 / 10
http://career.guru99.com/
outer_loop
inner_loop
Hash join
Build: It is a hash table having in-memory which is present on the smaller table.
Probe: this hash value of the hash table is applicable for each second row element.
Sort merge join
Two independent sources of data are joined in sort merge join. They performance is better as
compared to nested loop when the data volume is big enough but it is not good as hash joins
generally.
The full operation can be divided into parts of two:
Division of logical database into independent complete units for improving its management,
availability and performance is called Database partitioning.
8 / 10
http://career.guru99.com/
Splitting of one table which is large into smaller database entities logically is called database
partitioning. Its benefits are:
To improve query performance in situations dramatically when mostly rows which are
heavily accessed are in one partition.
Accessing large parts of a single partition
Slower and cheaper storage media can be used for data which is seldom used.
Query Evaluation Engine executes the low-level instructions that are generated by the compiler.
Atomicity: It’s an all or none concept which enables the user to be assured of incomplete
transactions to be taken care of. The actions involving incomplete transactions are left undone
in DBMS.
Aggregation: The collected entities and their relationship are aggregated in this model. It is
mainly used in expressing relationships within relationships.
Analysis Phase.
Redo Phase
Undo Phase
Compilations of objects make up this model in which values are stored within instance variables
which is inside the object. The object itself comprises bodies of object for its operation which are
called methods. Objects containing same kind of variables and methods are called classes.
It can be defined as being a ‘thing’ with an independent existence in the real world.
9 / 10
http://career.guru99.com/
Compilation of all entries of any particular type of entry in the database is called Entity Set.
Compilation of similar entity types into one particular type which is grouped together as an entity
set.
10 / 10
Powered by TCPDF (www.tcpdf.org)