100 SQL Interview Questions & Answers
🔹 Basics & Core Concepts
Q1. What is SQL?
SQL is a language used to store, retrieve, and manage data in relational databases.
Q2. What is a database?
A database is an organized collection of data.
Q3. What is a table?
A table stores data in rows and columns.
Q4. What is a primary key?
A primary key uniquely identifies records and cannot be NULL.
Q5. What is a foreign key?
A foreign key links tables by referencing a primary key.
Q6. What is a candidate key?
A column that can uniquely identify rows.
Q7. What is a composite key?
A key made of multiple columns.
Q8. What is NULL?
Represents missing or unknown value.
Q9. DELETE vs TRUNCATE?
DELETE removes rows conditionally, TRUNCATE removes all rows.
Q10. WHERE vs HAVING?
WHERE filters rows, HAVING filters groups.
No comments:
Post a Comment