Interview Questions

Top 5 SQL Interview Questions

Learning Outcome

5

Aggregating and summarizing your data.

 

4

Filtering rows at different stages in SQL

3

Three ways to remove data — with key differences.

2

Combining data from multiple tables with types.

1

Understanding Constraints that enforce data integrity.

Question 1

Primary Key vs Unique Key

🔑 Primary Key :-

• ❌ NULL values are not allowed
• 1️⃣ Only one PRIMARY KEY per table
• 🆔 Uniquely identifies every row

🔑 Unique Key :-

• ⚠️ Allows one NULL value
• 🔢 Multiple UNIQUE keys per table
• ✔️ Ensures uniqueness with flexibility

Question 2

Types of Joins

Question 3

Delete vs Truncate vs Drop

             🗑️ Delete

  • 🔎 Supports WHERE clause

  • ♻️ Can be rolled back

  • 🎯 Deletes selected records only

 

           ⚡ Truncate

  • 🚀 Faster than DELETE

  • ❌ Cannot use WHERE clause

  • 🧹 Removes all records quickly

 

            💥 Drop

  • 🗂️ Removes structure + data

  • ⚠️ Cannot be undone easily

  • 🗑️ Deletes the complete table

 

Question 4

Where vs Having

Filter Rows (WHERE)

Filter Groups (HAVING)

Group Rows (GROUP BY)

HAVING

Filters after GROUP BY. Designed to work with aggregate functions for grouped results.

 

 

WHERE

Filters rows before GROUP BY is applied. Cannot use aggregate functions like COUNT() or SUM().

 

Question 5

What is Group by?

You've Got This!

 

Walk into your SQL interview with confidence. Master these core SQL concepts and you'll stand out as a top candidate.

🚀 All the Best!

Copy of Interview Questions - Power BI

By Content ITV

Copy of Interview Questions - Power BI

  • 10