SQL_Interview_Questions_And_Answers
SQL_Interview_Questions_And_Answers
1. What is SQL?
SQL stands for Structured Query Language. It is used to communicate with databases and perform
The main types are DDL (Data Definition Language), DML (Data Manipulation Language), DCL
WHERE is used to filter records before grouping, while HAVING is used to filter groups after the
GROUP BY clause.
A primary key is a column or a set of columns that uniquely identifies each row in a table.
A foreign key is a column that creates a relationship between two tables by referencing the primary
6. What is normalization?
Normalization is the process of organizing data to reduce redundancy and improve data integrity.
INNER JOIN returns only matching records, while LEFT JOIN returns all records from the left table
By using prepared statements, parameterized queries, and ORM frameworks, you can prevent SQL
injection attacks.
Aggregate functions perform calculations on multiple values to return a single value. Examples: