๐ SQL Theoretical Interview Questions
๐ SQL Theoretical Interview Questions
2 min read
342 words
๐ฉโ๐ผ Business Analyst (BA)
๐น SQL Fundamentals
- What is SQL, and what purpose does it serve in data management?
- Differentiate between a database and a database management system (DBMS).
- What are the main SQL sublanguages (DDL, DML, DCL, TCL, DQL)?
- What are some common uses of SQL in business analysis?
- Is SQL a programming language? Explain why or why not.
๐น Tables, Keys, and Relationships
- What is a table in a relational database?
- What are primary and foreign keys, and why are they important?
- Explain referential integrity in simple terms.
- What are normalization and denormalization, and why do they matter in reporting?
- What are aggregate functions and why are they useful in analysis?
๐น Analytical Concepts
- Whatโs the difference between GROUP BY and HAVING?
- What is the order of SQL query execution and why does it matter?
- What is OLTP vs OLAP?
- How would you define and measure customer churn conceptually?
- What is ARPU (Average Revenue Per User)?
- How do you interpret retention and engagement in a dataset?
๐ Data Analyst (DA)
๐น SQL Architecture & Commands
- What is the purpose of DDL (Data Definition Language)?
- Whatโs the difference between DDL and DML commands?
- Explain COMMIT, ROLLBACK, and SAVEPOINT with examples.
- What are DCL commands (GRANT, REVOKE)?
- What are the most common SQL data types?
- Whatโs the difference between CHAR, VARCHAR, and NVARCHAR?
- How do you handle NULL values in SQL?
- What are COALESCE() and ISNULL() used for?
- Explain basic string and date functions in SQL.
- What are the different types of SQL joins?
๐น Views, Subqueries, and CTEs
- What is a VIEW and why is it useful?
- Explain a subquery and how it differs from a CTE.
- What is a correlated subquery?
- What are recursive CTEs and when are they applied?
๐น Indexes & Optimization Basics
- What is an index?
- What are clustered and non-clustered indexes?
- What happens when you create too many indexes?
- Explain the concept of query optimization.