0% found this document useful (0 votes)
94 views120 pages

TCS Prep Camp DBMS

This document summarizes the key topics and questions that will be covered in a TCS preparation camp on the topic of database management systems (DBMS). The document lists important DBMS topics like the fundamentals of DBMS, entity relationship diagrams, relational algebra and calculus, normalization, SQL, joins, and transactions. It then provides the questions and answers to 32 interview-based questions on various DBMS concepts such as what is a database, functional dependencies, normalization, SQL, views, stored procedures, triggers, indexes, and more.

Uploaded by

frzi frzi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views120 pages

TCS Prep Camp DBMS

This document summarizes the key topics and questions that will be covered in a TCS preparation camp on the topic of database management systems (DBMS). The document lists important DBMS topics like the fundamentals of DBMS, entity relationship diagrams, relational algebra and calculus, normalization, SQL, joins, and transactions. It then provides the questions and answers to 32 interview-based questions on various DBMS concepts such as what is a database, functional dependencies, normalization, SQL, views, stored procedures, triggers, indexes, and more.

Uploaded by

frzi frzi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 120

TCS Preparation Camp

TR(DBMS)
Vijay Kumar Dwivedi
ASST. PROFESSOR, CS/IT
UCER, Prayagraj
Mob. No. 9235668045
Vijay.kr.dwivedi@gmail.com
Important Topics in DBMS

Fundamental of DBMS

ERD

Relational Algebra & Relational Calculus

Normalization

SQL

Joins

Transaction
Interview based Questions
Question 1: What is database?
Question 1: What is database?
Answer: A database is a logically coherent
collection of data with some inherent meaning,
representing some aspect of real world and which
is designed, built and populated with data for a
specific purpose.
Question 2: What is a Database system?
Question 2: What is a Database system?
Answer: The database and DBMS software
together is called as Database system.
Question 3: What are the advantages of DBMS?
Question 3: What are the advantages of DBMS?

Answer: The advantages of DBMS are as follows:



Redundancy is controlled

Unauthorized access is restricted

Providing multiple user interfaces

Enforcing integrity constraints

Providing backup and recovery
Question 4: What is normalization?
Question 4: What is normalization?
Answer: It is a process of analysing the given
relation schemas based on their Functional
Dependencies (FDs) and primary key to achieve
the properties:

Minimizing redundancy

Minimizing insertion, deletion and update
anomalies.
Question 5: What is DDL (Data Definition Language)?
Question 5: What is DDL (Data Definition Language)?

Answer: A data base schema is specifies by a set


of definitions expressed by a special language
called DDL.
Question 6: What is Functional Dependency?
Question 6: What is Functional Dependency?

Answer: Functional dependency is a relationship


that exists when one attribute uniquely
determines another attribute. Functional
dependency in a database serves as a constraint
between two sets of attributes.
Question 7: What is 2NF?
Question 7: What is 2NF?
Answer: A relation schema R is in 2NF if it is in
1NF and every non-prime attribute A in R is fully
functionally dependent on primary key
Question 8: What is the difference between
primary key and unique constraints?
Question 8: What is the difference between
primary key and unique constraints?
Answer: Primary key cannot have NULL value, the
unique constraints can have NULL values.
One primary key can exist a table, but there can
be multiple unique constrains in the same table.
Question 9: What is SQL?
Question 9: What is SQL?

Structured Query Language (SQL) is a standard
computer language for relational database
management and data manipulation. SQL is
used to query, insert, update and modify data
Question 10: What is a view in SQL? How to create it?
Question 10: What is a view in SQL? How to create it?

A view is a virtual table created according to the result set
of an SQL statement.

A view contains rows and columns, just like a real table.

The columns in the view are the columns from one or
more real tables in the database.

SQL functions, WHERE, and JOIN statements can also be
added to the view.

Create View Statement is used to create view in SQL

CREATE VIEW view_name AS
 SELECT column1, column2, ...
 FROM table_name
 WHERE condition;
:

Question 11: What is a data Model?


:

Question 11: What is a data Model?


Ans: A collection of conceptual tools for
describing data, data relationships data
semantics and constraints.
:

Question 11: What is a ER- Model?


:

Question 11: What is a ER- Model?


Ans:
This data model is based on real world that
consists of basic objects called entities and of
relationship among these objects.
Entities are described in a database by a set of
attributes.
Question 12: What is Query Evaluation Engine ?
Question 12: What is Query Evaluation Engine ?

Query evaluation engine is importent part of


SQL(structured query language) because all the
query evaluated in SQL with help of query
evaluation engine.
 It executes low-level instruction generates by
compiler. and provides specific output.
Question 13: What is meant by query optimization?
Question 13: 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.
Question 14: Differentiate between DBMS and RDBMS?
Question 14: Differentiate between DBMS and RDBMS?

DBMS provides a systematic and organized way


of storing, managing and retrieving from
collection of logically related information.
RDBMS also provides what DBMS provides but
above that it provides relationship integrity.
Question 15: What is SQL?
Question 15: What is SQL?

SQL stands for Structured Query Language. SQL


is an ANSI (American National Standards
Institute) standard computer language for
accessing and manipulating database systems.
SQL statements are used to retrieve and
update data in a database.
Question 16: What is Stored Procedure?
Question 16: What is Stored Procedure?

A stored procedure is a named group of SQL


statements that have been previously created
and stored in the server database.
Question 17: What is Trigger?
Question 17: What is Trigger?

A trigger is a SQL procedure that initiates an


action when an event (INSERT, DELETE or
UPDATE) occurs.
Question 18: What is Index?
Question 18: What is Index?

Indexes are special lookup tables that the


database search engine can use to speed up
data retrieval.
An index is a pointer to data in a table
Question 19: What is extension and intension?
Question 19: What is extension and intension?

Extension -It is the number of tuples present in a


table at any instance. This is time dependent.

Intension -It is a constant value that gives the


name, structure of table and the constraints
laid on it.
Question 20: What do you mean by
atomicity and aggregation?
Question 20: What do you mean by atomicity and aggregation?

Ans: Atomicity-Atomicity states that database


modifications must follow an all or nothing rule.
Each transaction is said to be atomic. If one part
of the transaction fails, the entire transaction fails.

Aggregation - A feature of the entity relationship


model that allows a relationship set to participate
in another relationship set. This is indicated on an
ER diagram by drawing a dashed box around the
aggregation.
Qustion 21: What is VDL ?
Qustion 21: What is VDL ?


It stands for View defintion language

It specifies user views and their mappings to
the conceptual schema.
Question 22: What is SDL?
Question 22: What is SDL?

It stands for Storage Defintion Language


This language is to specify the internal
schema.
 This language may Specify the mapping
between two schemas.
Question 23: Describe Concurrency Control?
Question 23: Describe Concurrency Control?

 Concurrency control is the process managing


simultaneous operations against a database so
that database integrity is no compromised.
There are two approaches to concurrency
control.
 The pessimistic approach involves locking
and the optimistic approach involves
versioning.
Question 24: Describe the difference between
homogeneous and heterogeneous distributed
database?
Question 24: Describe the difference between
homogeneous and heterogeneous distributed
database?
 A homogenous database is one that uses
the same DBMS at each node.
 A heterogeneous database is one that may
have a different DBMS at each node.
Question 25: What is a distributed database?
Question 25: What is a distributed database?

A distributed database is a single logical


database that is spread across more than one
node or locations that are all connected via
some communication link.
Question 26: Explain the difference between
two and three-tier architectures?
Question 26: Explain the difference between
two and three-tier architectures?
Three-tier architecture includes a client and
two server layers.

The application code is stored on the


application server and the database is stored
on the database server.
A two-tier architecture includes a client and
one server layer. The database is stored on the
database server.
Question 27: Explain the differences between an
intranet and an extranet databases?
Question 27: Explain the differences between an
intranet and an extranet databases?

An Internet database is accessible by everyone


who has access to a Web site.
An intranet database limits access to only
people within a given organization.
Question 28: What is SQL Deadlock?
Question 28: What is SQL Deadlock?

Deadlock is a unique situation in a multi user


system that causes two or more users to wait
indefinitely for a locked resource.
Question 29: What is a Catalog?
Question 29: What is a Catalog?

A catalog is a table that contains the


information such as structure of each file, the
type and storage format of each data item and
various constraints on the data .
The information stored in the catalog is called
Metadata.
Question 30: What is data ware housing & OLAP?
Question 30: What is data ware housing & OLAP?

Data warehousing and OLAP (online analytical


processing) systems are the techniques used in
many companies to extract and analyze useful
information from very large databases for
decision making .
Quesion 31: Describe the three levels of data
abstraction?
Quesion 31: Describe the three levels of data
abstraction?

Physical level: The lowest level of abstraction


describes how data are stored.
Logical level: The next higher level of
abstraction, describes what data are stored in
database and what relationship among those
data.
View level: The highest level of abstraction
describes only part of entire database.
Question 32: What is Data Independence?
Question 32: What is Data Independence?

Data independence means that the application


is independent of the storage structure and
access strategy of data.
Question 33: What is Collation?
Question 33: What is Collation?

Collation refers to a set of rules that determine


how data is sorted and compared.
Question 34: What is difference between
DELETE & TRUNCATE commands?
Question 34: What is difference between
DELETE & TRUNCATE commands?
Delete command removes the rows from a
table based on the condition that we provide
with a WHERE clause.
Truncate will actually remove all the rows from
a table and there will be no data in the table
after we run the truncate command.
Question 34: What is a Transaction?
Question 34: What is a Transaction?

A transaction is a logical unit of database


processing that includes one or more database
access operations.
Question 35: What are the different phases of
Transaction?
Question 35: What are the different phases of
Transaction?

Analysis phase

Redo phase

Undo phase
Question 36: What is transparent dbms?
Question 36: What is transparent dbms?

It is one, which keeps its physical structure


hidden from user.
Question 37: Explain the differences between
structured data and unstructured data.
Question 37: Explain the differences between
structured data and unstructured data.
Structured data are facts concerning objects
and events. The most important structured
data are numeric, character, and dates.

Structured data are stored in tabular form.


Unstructured data are multimedia data such as
documents, photographs, maps, images,
sound, and video clips. Unstructured data are
most commonly found on Web servers and
Web-enabled databases.
Question 38: What is a dependency graph?
Question 38: What is a dependency graph?

A dependency graph is a diagram that is used


to portray the connections between database
elements.
Question 39: Explain the difference between an
exclusive lock and a shared lock?
Question 39: Explain the difference between an
exclusive lock and a shared lock?
An exclusive lock prohibits other users from
reading the locked resource; a shared lock
allows other users to read the locked resource,
but they cannot update it.
Question 40: Why should we use triggers?
Question 40: Why should we use triggers?

(1)Providing default values


(2) Enforcing data constraints
(3) Updating views and
(4) Enforcing referential integrity
Question 41: What are the advantages of
using stored procedures?
Question 41: What are the advantages of
using stored procedures?
The advantages of stored procedures are:
(1) Greater security
(2) Decreased network traffic
(3) SQL can be optimized and
(4) Code sharing which leads to less work,
standardized processing, and specialization
among developers.
Question 42: Describe the difference between
embedded and dynamic SQL?
Question 42: Describe the difference between
embedded and dynamic SQL?
Embedded SQL is the process of including hard
coded SQL statements. These statements do
not change unless the source code is modified.
Dynamic SQL is the process of generating SQL
on the fly.The statements generated do not
have to be the same each time.
Question 43: Explain a join between tables
Question 43: Explain a join between tables

A join allows tables to be linked to other tables


when a relationship between the tables exists.
The relationships are established by using a
common column in the tables and often uses
the primary/foreign key relationship.
Question 44: Describe a subquery.
Question 44: Describe a subquery.

A subquery is a query that is composed of two


queries. The first query (inner query) is within
the WHERE clause of the other query (outer
query).
Question 45: Explain the difference between a
dynamic and materialized view.
Question 45: Explain the difference between a
dynamic and materialized view.
A dynamic view may be created every time
that a specific view is requested by a user.
A materialized view is created and or updated
infrequently and it must be synchronized with
its associated base table(s).
Question 46: Explain minimum and maximum
cardinality?
Question 46: Explain minimum and maximum
cardinality?

Minimum cardinality is the minimum number


of instances of an entity that can be associated
with each instance of another entity.
Maximum cardinality is the maximum number
of instances of an entity that can be associated
with each instance of another entity.
Question 47: Explain what we mean by an ACID
transaction.
Question 47: Explain what we mean by an ACID
transaction.

An ACID transaction is one that is atomic,


consistent, isolated, and durable.
Durable means that database changes are
permanent.
Consistency can mean either statement level or
transaction level consistency.
With transaction level consistency, a
transaction may not see its own changes.
Atomic means it is performed as a unit.
Question 48: What is Specialization?
Question 48: What is Specialization?

It is the process of defining a set of subclasses


of an entity type where each subclass contain
all the attributes and relationships of the
parent entity and may have additional
attributes and relationships which are specific
to itself.
Question 48: What is generalization?
Question 48: What is generalization?

It is the process of finding common attributes


and relations of a number of entities and
defining a common super class for them.
Question 49: What is Lossless join property?
Question 49: What is Lossless join property?

It guarantees that the spurious tuple generation


does not occur with respect to relation
schemas after decomposition.
Question 50: What is schema?
Question 50: What is schema?

The description of a data base is called the


database schema , which is specified during
database design and is not expected to change
frequently.
A displayed schema is called schema diagram.
Why we need keys in DBMS ?
Why we need keys in DBMS ?

Keys help you to identify any row of data in a
table.

Allows to establish a relationship between and
identify the relation between tables

Helps to enforce identity and integrity in the
relationship.
Keys in DBMS
Keys in DBMS

Super Key

Primary Key

Candidate Key

Alternate Key

Foreign Key

Compound Key

Composite Key

Surrogate Key
Normalization
Normalization in DBMS:
 Normalization is a process of organizing the data in database to
avoid data redundancy, insertion , updation & deletion anomaly.
First Normal Form (1NF) is a simple form of Normalization.
Second Normal Form (2NF) In 2NF, the table is required in 1NF.
Third Normal Form (3NF)
BCNF (Boyce – Code Normal Form)
Fourth Normal Form (4NF)
Fifth Normal Form (5NF)
DKNF (Domain Key Normal Form)
Normalization
Normalization in DBMS:
 Normalization is a process of organizing the data in database to
avoid data redundancy, insertion , updation & deletion anomaly.
First Normal Form (1NF) is a simple form of Normalization.
Second Normal Form (2NF) In 2NF, the table is required in 1NF.
Third Normal Form (3NF)
BCNF (Boyce – Code Normal Form)
Fourth Normal Form (4NF)
Fifth Normal Form (5NF)
DKNF (Domain Key Normal Form)
Functional Dependency
•  Functional dependency is a constraint that
describes the relationship between attributes in a
relation.
• 1NF – UNIQUE VALUE
• 2NF – REMOVAL OF PARTIAL FD
• 3NF – REMOVAL OF TRANSITIVE FD
• 3.5 NF – BCNF : LEFT HAND SIDE MUST BE A Super
KEY
• 4NF – REMOVAL OF MULTIVALUED FD
• 5NF – REMOVAL OF JOIN FD
Difference between SQL and MySQL

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