SQL_OOPs_Interview_Questions
SQL_OOPs_Interview_Questions
1. What is SQL?
SQL (Structured Query Language) is a standard programming language for managing and
manipulating relational databases. It is used to perform tasks such as querying data, updating
SQL commands are classified into DDL (Data Definition Language), DML (Data Manipulation
Language), DCL (Data Control Language), and TCL (Transaction Control Language). Examples
A primary key is a column or a set of columns in a table that uniquely identifies each row in that
table. It must contain unique values and cannot have NULL values.
A foreign key is a column or set of columns in one table that refers to the primary key in another
5. What is normalization?
Normalization is the process of organizing data in a database to reduce redundancy and improve
Joins are used in SQL to combine rows from two or more tables based on a related column. Types
include INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN, and CROSS JOIN.
WHERE is used to filter rows before grouping, while HAVING is used to filter groups after
aggregation.
An index is a database object that improves the speed of data retrieval operations. It works like an
A view is a virtual table that is based on the result set of an SQL query. It does not store data
DELETE removes rows one at a time and can be rolled back. TRUNCATE removes all rows from a
A database is an organized collection of data stored electronically that allows for efficient data
DBMS (Database Management System) is software that interacts with users and applications to
A relational database organizes data into tables (relations) with rows and columns. Relationships
ACID stands for Atomicity, Consistency, Isolation, and Durability. It is a set of properties that
OOP is a programming paradigm based on the concept of objects, which contain data (attributes)
The four principles of OOP are Encapsulation, Abstraction, Inheritance, and Polymorphism.
Encapsulation is the process of wrapping data and methods into a single unit, restricting direct
Inheritance is a mechanism where one class (child) derives properties and behavior from another
class (parent).
Polymorphism allows objects to be treated as instances of their parent class, enabling a single