ADBMS Short Answers
ADBMS Short Answers
What is DBMS?
A Database Management System (DBMS) is software used to create, manage, and operate databases. It
provides tools for data insertion, retrieval, updating, and deletion. DBMS ensures data integrity, security, and
reduces data redundancy. It supports multiple users and maintains concurrency control. Examples: MySQL,
Oracle, PostgreSQL. It allows backup and recovery and uses schemas to define data structure.
What is RDBMS?
Relational DBMS (RDBMS) is a type of DBMS based on the relational model by E.F. Codd. Data is organized
into tables (relations) with rows and columns. It uses SQL for querying. RDBMS maintains relationships using
keys (primary, foreign). Examples include Oracle, MySQL, and SQL Server. It supports ACID properties and
DML (Data Manipulation Language): SELECT, INSERT, UPDATE, DELETE manipulates data.
GROUP BY groups rows with the same values in columns and is used with aggregate functions.
HAVING filters grouped records based on a condition (used with GROUP BY).
String operations include CONCAT, LENGTH, SUBSTR, UPPER, LOWER, TRIM, etc.
Set operations combine results of two or more queries: UNION, INTERSECT, MINUS/EXCEPT.
UNION combines without duplicates, INTERSECT gives common rows, MINUS returns rows from first query
not in second.
A nested subquery is a query inside another query. It runs first and its result is used by the outer query.
They can be in SELECT, FROM, or WHERE clauses. Types include scalar, row, and correlated subqueries.
Embedded SQL is SQL written within a programming language like C, Java. Uses host variables.
Dynamic SQL is constructed and executed at runtime. Allows flexible query construction based on conditions.
Joins combine rows from two or more tables based on a related column.
Types: INNER JOIN (matching rows), LEFT JOIN (all left rows + matched), RIGHT JOIN, FULL JOIN.
Functions return a value; Procedures may not. Functions are used in SELECT, WHERE, etc.
Procedures are blocks of code for tasks, may or may not return values.
Functions are similar but always return a single value. Functions are invoked in SQL statements.
Steps: Declare, Open, Fetch, Close. Types: Implicit, Explicit. Used when query returns multiple rows.
Describe PL/SQL.
PL/SQL is Oracles procedural extension to SQL. It includes loops, conditions, and variables.
Describe exception.
Exceptions are errors during program execution. Types: Predefined (e.g., NO_DATA_FOUND), User-defined.
Handled using EXCEPTION block in PL/SQL: BEGIN ... EXCEPTION WHEN ... THEN ... END;
What is a trigger?
A trigger is a stored procedure that automatically executes in response to specific database events.
Used for auditing, validation, and enforcing business rules. Fires on INSERT, UPDATE, DELETE.
What is NoSQL?
NoSQL databases are non-relational, used for large-scale data storage and real-time web apps.
Need: Scalability, performance with big data, flexibility with data models.
Example: