Viva Questions Java DBMS
Viva Questions Java DBMS
What is Java?
Java is a high-level, platform-independent, object-oriented programming language.
What is an array?
An array is a collection of elements of the same type stored in contiguous memory locations.
What is a class?
A class is a blueprint for creating objects, defining their properties and behavior.
What is an object?
An object is an instance of a class containing data (fields) and methods to manipulate that
data.
What is polymorphism?
The ability of an object to take many forms, achieved through method overloading and
overriding.
What is an interface?
An interface is a reference type in Java containing abstract methods. It is implemented using
the implements keyword.
What is encapsulation?
Encapsulation is bundling data and methods operating on that data within a single unit
(class).
What is DBMS?
DBMS (Database Management System) is software for managing databases.
What is a database?
A database is an organized collection of data.
What is RDBMS?
Relational Database Management System, where data is stored in tables with relationships.
What is a table?
A table is a collection of rows and columns.
What is SQL?
Structured Query Language is used to interact with databases.
What is normalization?
Process of organizing data to reduce redundancy.
What is a schema?
A schema is the structure of a database, defined formally.
What is a query?
A query is a request for data or information from a database.
What is a view?
A view is a virtual table based on the result of a SQL query.
What is a transaction?
A transaction is a unit of work performed against a database.
What are ACID properties?
Atomicity, Consistency, Isolation, and Durability - properties ensuring reliable transactions.
What is indexing?
Indexing improves the speed of data retrieval operations on a table.
What is a join?
A join combines rows from two or more tables based on a related column.
What is a subquery?
A query nested inside another query.
What is a constraint?
A constraint limits the type of data that can go into a table, e.g., PRIMARY KEY, FOREIGN
KEY, UNIQUE, NOT NULL.
What is a trigger?
A trigger is a procedure executed automatically in response to certain events on a table.
What is a cursor?
A cursor is a database object used to retrieve, manipulate, and navigate through query
results.
What is a deadlock?
A deadlock occurs when two or more transactions wait for each other to release resources,
preventing further progress.
A candidate key is a minimal set of attributes that can uniquely identify a tuple in a table.
A composite key is a key that consists of two or more attributes to uniquely identify a
record.
A surrogate key is a unique identifier for a record, often generated by the system, and has
no business meaning.
A primary key uniquely identifies records and does not allow NULL. A unique key ensures
uniqueness but can allow a single NULL value.
It is used to generate a unique number automatically whenever a new row is inserted into a
table.
Constraints enforce rules at the table or column level to maintain data integrity. Examples
include NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY, and CHECK.
Referential integrity ensures that foreign key values in a child table match primary key
values in the parent table.
A cross join produces a Cartesian product of two tables, pairing each row from the first table
with all rows from the second.
A cursor is a database object used to retrieve and manipulate rows returned by a query one
at a time.
21. What is a transaction log?
A transaction log records all transactions performed on a database to ensure durability and
recovery in case of a failure.
A materialized view stores the results of a query physically on disk, unlike a regular view,
which is virtual.
A phantom read occurs when new rows are added by another transaction after a query is
executed in the current transaction.
Partitioning divides a table into smaller parts for better performance and manageability.
A database cluster consists of multiple databases managed as a single entity to ensure high
availability and scalability.
Stored functions are similar to stored procedures but return a single value and are often
used in expressions.