0% found this document useful (0 votes)
5 views23 pages

SQL Interview Questions

This document provides a comprehensive overview of SQL fundamentals, including definitions of SQL, databases, and key concepts such as primary keys, foreign keys, and constraints. It covers SQL command types, filtering conditions, NULL handling, aggregate functions, joins, subqueries, set operators, string and date functions, and window functions. Each section includes questions and answers to facilitate understanding of SQL for interview preparation.

Uploaded by

ghosalbidisha0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views23 pages

SQL Interview Questions

This document provides a comprehensive overview of SQL fundamentals, including definitions of SQL, databases, and key concepts such as primary keys, foreign keys, and constraints. It covers SQL command types, filtering conditions, NULL handling, aggregate functions, joins, subqueries, set operators, string and date functions, and window functions. Each section includes questions and answers to facilitate understanding of SQL for interview preparation.

Uploaded by

ghosalbidisha0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SQL Interview Questions with Answers

SQL Fundamentals
1. What is SQL?​
Answer: SQL stands for Structured Query Language. It is used to store, retrieve, update, delete,
and manage data in relational databases.

2. Why is SQL used?​


Answer: SQL is used because most business data is stored in databases. It helps users extract
meaningful information from large datasets quickly and accurately.

3. Is SQL a programming language?​


Answer: SQL is mainly a query language, not a full programming language. It tells the database
what data is needed rather than giving step-by-step instructions on how to process it.

4. What is a database?​
Answer: A database is an organized collection of data stored electronically. It allows easy
storage, retrieval, updating, and management of data.

5. What is a relational database?​


Answer: A relational database stores data in tables. These tables are related to each other
using common columns such as IDs or keys.

6. What is a table in SQL?​


Answer: A table is a structured format used to store data in rows and columns. Each table
usually represents one business entity such as customers, employees, or orders.

7. What is a row in SQL?​


Answer: A row represents a single record in a table. For example, one row in an employee table
may represent one employee.

8. What is a column in SQL?​


Answer: A column represents a specific attribute of a table. For example, employee name,
salary, department, and joining date are columns.

9. What is a field in SQL?​


Answer: A field is the individual value stored at the intersection of a row and a column.

10. Is SQL case-sensitive?​


Answer: SQL keywords are usually not case-sensitive. However, data values may be
case-sensitive depending on the database settings and collation.
Keys and Constraints
11. What is a primary key?​
Answer: A primary key uniquely identifies each record in a table. It does not allow duplicate or
NULL values.

12. Why is a primary key important?​


Answer: A primary key helps maintain uniqueness and allows records to be identified accurately.
It is also used to create relationships between tables.

13. Can a table have more than one primary key?​


Answer: No, a table can have only one primary key. However, that primary key may consist of
more than one column, called a composite key.

14. What is a foreign key?​


Answer: A foreign key is a column that links one table to another table. It usually refers to the
primary key of another table.

15. Why is a foreign key important?​


Answer: A foreign key maintains relationships between tables and ensures referential integrity.

16. What is referential integrity?​


Answer: Referential integrity ensures that relationships between tables remain valid. For
example, an order should not exist for a customer who is not present in the customer table.

17. What is a candidate key?​


Answer: A candidate key is any column or set of columns that can uniquely identify a record.
One candidate key is chosen as the primary key.

18. What is a super key?​


Answer: A super key is any combination of columns that can uniquely identify a record. It may
contain extra columns that are not strictly necessary.

19. What is a composite key?​


Answer: A composite key is a key made up of two or more columns. It is used when one column
alone cannot uniquely identify a record.

20. What is a surrogate key?​


Answer: A surrogate key is an artificial key generated by the system, such as an auto-increment
ID. It usually has no business meaning.
21. What is a natural key?​
Answer: A natural key is a real-world business value that can uniquely identify a record, such as
email ID, employee code, or PAN number.

22. What is the difference between primary key and unique key?​
Answer: A primary key does not allow NULL values and only one primary key can exist in a
table. A unique key prevents duplicates but may allow NULL values depending on the database.

23. What is a constraint in SQL?​


Answer: A constraint is a rule applied to a column or table to maintain data accuracy and
consistency.

24. What is a NOT NULL constraint?​


Answer: A NOT NULL constraint ensures that a column must always contain a value. It prevents
missing data in important fields.

25. What is a UNIQUE constraint?​


Answer: A UNIQUE constraint ensures that all values in a column are different. It prevents
duplicate entries.

26. What is a CHECK constraint?​


Answer: A CHECK constraint restricts values based on a condition. For example, age must be
greater than or equal to 18.

27. What is a DEFAULT constraint?​


Answer: A DEFAULT constraint automatically assigns a predefined value when no value is
provided for a column.

SQL Command Types


28. What is DDL?​
Answer: DDL stands for Data Definition Language. It is used to define and modify database
structure, such as creating or altering tables.

29. What are examples of DDL commands?​


Answer: Common DDL commands are CREATE, ALTER, DROP, and TRUNCATE.

30. What is DML?​


Answer: DML stands for Data Manipulation Language. It is used to work with data stored inside
tables.

31. What are examples of DML commands?​


Answer: Common DML commands are SELECT, INSERT, UPDATE, and DELETE.
32. What is DCL?​
Answer: DCL stands for Data Control Language. It is used to control access and permissions in
the database.

33. What are examples of DCL commands?​


Answer: Common DCL commands are GRANT and REVOKE.

34. What is TCL?​


Answer: TCL stands for Transaction Control Language. It is used to manage database
transactions.

35. What are examples of TCL commands?​


Answer: Common TCL commands are COMMIT, ROLLBACK, and SAVEPOINT.

DELETE, TRUNCATE, DROP


36. What is the difference between DELETE and TRUNCATE?​
Answer: DELETE removes selected rows and can use a WHERE condition. TRUNCATE
removes all rows from a table and is usually faster.

37. What is the difference between TRUNCATE and DROP?​


Answer: TRUNCATE removes all data but keeps the table structure. DROP removes the entire
table along with its structure.

38. What is the difference between DELETE and DROP?​


Answer: DELETE removes data from a table, while DROP removes the table itself from the
database.

39. Which is faster, DELETE or TRUNCATE?​


Answer: TRUNCATE is usually faster because it removes all rows without scanning each row
individually.

40. When should DELETE be used instead of TRUNCATE?​


Answer: DELETE should be used when only selected rows need to be removed or when
conditions are required.

SELECT and SQL Execution


41. What is SELECT used for?​
Answer: SELECT is used to retrieve data from one or more tables in a database.
42. What is the logical order of SQL execution?​
Answer: The common logical order is FROM, WHERE, GROUP BY, HAVING, SELECT, ORDER
BY, and LIMIT.

43. Why is SQL execution order important?​


Answer: It helps explain why some clauses can use aliases and some cannot. It also helps in
writing correct queries.

44. Can we use aliases in WHERE clauses?​


Answer: Usually no, because WHERE is processed before SELECT, and aliases are created in
SELECT.

45. Can we use aliases in the ORDER BY clause?​


Answer: Yes, because ORDER BY is processed after SELECT, so it can recognize aliases.

46. What is DISTINCT used for?​


Answer: DISTINCT is used to remove duplicate rows from the result set.

47. What is ORDER BY used for?​


Answer: ORDER BY is used to sort query results in ascending or descending order.

Filtering and Conditions


48. What is the WHERE clause?​
Answer: WHERE is used to filter rows before grouping or aggregation. It applies conditions to
individual records.

49. What is the HAVING clause?​


Answer: HAVING is used to filter grouped or aggregated results. It is commonly used with
GROUP BY.

50. What is the difference between WHERE and HAVING?​


Answer: WHERE filters rows before aggregation, while HAVING filters groups after aggregation.

51. What is the IN operator?​


Answer: IN is used to check whether a value matches any value from a given list.

52. What is the BETWEEN operator?​


Answer: BETWEEN is used to filter values within a range. It includes both the starting and
ending values.

53. Is BETWEEN inclusive?​


Answer: Yes, BETWEEN includes both boundary values.
54. What is the LIKE operator?​
Answer: LIKE is used for pattern matching in text data.

55. What is the difference between % and _ in LIKE?​


Answer: % matches any number of characters, while _ matches exactly one character.

56. What is the difference between IN and EXISTS?​


Answer: IN compares values with a list, while EXISTS checks whether a subquery returns any
result. EXISTS is often better for large subqueries.

NULL Handling
57. What is NULL in SQL?​
Answer: NULL means missing, unknown, or unavailable value. It is different from zero or blank.

58. Is NULL equal to zero?​


Answer: No, NULL means absence of value, while zero is an actual numeric value.

59. Is NULL equal to blank?​


Answer: No, blank is an empty text value, while NULL means no value exists.

60. Why should we not use = NULL?​


Answer: Because NULL is unknown. SQL uses IS NULL or IS NOT NULL to check NULL
values.

61. What is COALESCE?​


Answer: COALESCE returns the first non-NULL value from a list. It is often used to replace
missing values.

62. What is the importance of NULL handling in analytics?​


Answer: Incorrect handling of NULL values can lead to wrong totals, averages, counts, and
business conclusions.

Aggregate Functions
63. What are aggregate functions?​
Answer: Aggregate functions perform calculations on multiple rows and return a single
summarized value.
64. Name some common aggregate functions.​
Answer: Common aggregate functions are COUNT, SUM, AVG, MIN, and MAX.

65. What is COUNT used for?​


Answer: COUNT is used to count the number of rows or non-NULL values in a column.

66. What is the difference between COUNT(*) and COUNT(column)?​


Answer: COUNT(*) counts all rows, while COUNT(column) ignores NULL values in that column.

67. What is SUM used for?​


Answer: SUM is used to calculate the total of numeric values.

68. What is AVG used for?​


Answer: AVG is used to calculate the average of numeric values.

69. What is MIN used for?​


Answer: MIN returns the smallest value from a column.

70. What is MAX used for?​


Answer: MAX returns the largest value from a column.

71. Can aggregate functions be used in WHERE?​


Answer: No, aggregate functions are generally used with HAVING because WHERE is
processed before aggregation.

GROUP BY
72. What is GROUP BY used for?​
Answer: GROUP BY is used to group rows that have the same values in specified columns. It is
commonly used with aggregate functions.

73. Why is GROUP BY important in business analytics?​


Answer: GROUP BY helps create summaries such as sales by region, revenue by month,
employees by department, and leads by source.

74. Can GROUP BY be used without aggregate functions?​


Answer: Yes, but in such cases it behaves similarly to DISTINCT by returning unique
combinations.

75. What is the difference between GROUP BY and DISTINCT?​


Answer: DISTINCT removes duplicate rows, while GROUP BY is mainly used for aggregation
and summarization.
Joins
76. What is a JOIN?​
Answer: A JOIN is used to combine data from two or more tables based on related columns.

77. Why are joins important?​


Answer: Business data is usually stored in multiple tables. Joins help combine customer, order,
product, employee, and department data for analysis.

78. What is an INNER JOIN?​


Answer: INNER JOIN returns only matching records from both tables.

79. What is a LEFT JOIN?​


Answer: LEFT JOIN returns all records from the left table and matching records from the right
table. If no match exists, NULL is returned.

80. What is a RIGHT JOIN?​


Answer: RIGHT JOIN returns all records from the right table and matching records from the left
table.

81. What is a FULL OUTER JOIN?​


Answer: FULL OUTER JOIN returns all records from both tables, whether they match or not.

82. What is a SELF JOIN?​


Answer: A SELF JOIN joins a table with itself. It is useful for employee-manager or parent-child
relationships.

83. What is a CROSS JOIN?​


Answer: CROSS JOIN returns the Cartesian product of two tables. Each row from one table is
combined with each row from another table.

84. What happens if we forget the JOIN condition?​


Answer: The query may produce a Cartesian product, leading to a very large and incorrect
result.

85. What is the difference between JOIN and subquery?​


Answer: JOIN combines data from tables, while a subquery uses the result of one query inside
another query. Joins are often better for readability and performance.

86. What is the difference between ON and WHERE in joins?​


Answer: ON defines how tables are matched. WHERE filters the final result after joining.
Subqueries and CTEs
87. What is a subquery?​
Answer: A subquery is a query written inside another query. It helps solve problems in steps.

88. What is a single-row subquery?​


Answer: A single-row subquery returns only one value. It is commonly used with operators like
=, >, or <.

89. What is a multi-row subquery?​


Answer: A multi-row subquery returns multiple values. It is commonly used with IN, ANY, or ALL.

90. What is a correlated subquery?​


Answer: A correlated subquery depends on the outer query. It may execute once for each row
processed by the outer query.

91. What is a derived table?​


Answer: A derived table is a subquery used in the FROM clause. It behaves like a temporary
table for that query.

92. What is a CTE?​


Answer: CTE stands for Common Table Expression. It is a temporary named result set created
using WITH.

93. Why are CTEs useful?​


Answer: CTEs make complex queries easier to read, understand, and maintain.

94. What is the difference between CTE and subquery?​


Answer: A CTE is usually more readable and reusable within the same query. A subquery is
written directly inside another query.

95. What is a recursive CTE?​


Answer: A recursive CTE is a CTE that refers to itself. It is used for hierarchical data such as
organization charts or category trees.

Set Operators
96. What is UNION?​
Answer: UNION combines results of two queries and removes duplicate records.

97. What is UNION ALL?​


Answer: UNION ALL combines results of two queries and keeps duplicate records.
98. What is the difference between UNION and UNION ALL?​
Answer: UNION removes duplicates, while UNION ALL keeps duplicates and is usually faster.

99. What is INTERSECT?​


Answer: INTERSECT returns only the common rows between two result sets.

100. What is EXCEPT or MINUS?​


Answer: EXCEPT or MINUS returns rows from the first query that are not present in the second
query.

String and Date Functions


101. What are string functions in SQL?​
Answer: String functions are used to clean, modify, combine, or extract text data.

102. What is TRIM used for?​


Answer: TRIM removes extra spaces from the beginning and end of text values.

103. What is CONCAT used for?​


Answer: CONCAT is used to combine two or more text values into one.

104. What is SUBSTRING used for?​


Answer: SUBSTRING is used to extract part of a text value.

105. Why are string functions important in analytics?​


Answer: They help clean names, emails, phone numbers, categories, and other text-based
business data.

106. What are date functions in SQL?​


Answer: Date functions are used to extract, compare, calculate, or format date and time values.

107. What is the difference between NOW and CURRENT_DATE?​


Answer: NOW returns both date and time, while CURRENT_DATE returns only the current date.

108. Why are date functions important in business analysis?​


Answer: Date functions help analyze trends such as monthly revenue, yearly growth, customer
inactivity, and employee joining patterns.

Window Functions
109. What are window functions?​
Answer: Window functions perform calculations across related rows without reducing the
number of rows in the result.

110. How are window functions different from aggregate functions?​


Answer: Aggregate functions collapse rows into summary results, while window functions keep
individual rows and add calculated values.

111. What is ROW_NUMBER?​


Answer: ROW_NUMBER assigns a unique sequential number to each row within a result set or
group.

112. What is RANK?​


Answer: RANK assigns ranking values and gives the same rank to tied records, but skips the
next rank.

113. What is DENSE_RANK?​


Answer: DENSE_RANK also gives the same rank to tied records, but it does not skip the next
rank.

114. What is the difference between RANK and DENSE_RANK?​


Answer: RANK skips numbers after ties, while DENSE_RANK continues ranking without gaps.

115. What is PARTITION BY?​


Answer: PARTITION BY divides data into groups for window function calculations.

116. What is ORDER BY inside a window function?​


Answer: ORDER BY inside a window function defines the sequence in which calculation or
ranking is applied.

117. What is LAG?​


Answer: LAG is used to access data from a previous row. It is useful for comparing current
performance with previous performance.

118. What is LEAD?​


Answer: LEAD is used to access data from the next row. It helps compare current data with
future data.

Normalization and Database Design


119. What is normalization?​
Answer: Normalization is the process of organizing data to reduce duplication and improve data
integrity.
120. Why is normalization important?​
Answer: It avoids repeated data, reduces storage issues, and prevents update, insert, and
delete anomalies.

121. What is 1NF?​


Answer: First Normal Form means each column should contain atomic values, and there should
be no repeating groups.

122. What is 2NF?​


Answer: Second Normal Form means the table should be in 1NF and every non-key column
should fully depend on the complete primary key.

123. What is 3NF?​


Answer: Third Normal Form means the table should be in 2NF and should not have transitive
dependency.

124. What is denormalization?​


Answer: Denormalization intentionally adds redundancy to improve read performance. It is often
used in reporting and analytics systems.

125. What is a one-to-one relationship?​


Answer: A one-to-one relationship means one record in a table is related to only one record in
another table.

126. What is a one-to-many relationship?​


Answer: A one-to-many relationship means one record in a table can be related to many
records in another table.

127. What is a many-to-many relationship?​


Answer: A many-to-many relationship means multiple records in one table can relate to multiple
records in another table.

128. How is a many-to-many relationship handled?​


Answer: It is handled using a bridge table or junction table.

Indexing and Performance


129. What is an index?​
Answer: An index is a database structure that improves the speed of data retrieval.

130. Why are indexes used?​


Answer: Indexes are used to find records faster, especially in large tables.
131. What is a clustered index?​
Answer: A clustered index physically organizes table data based on the indexed column.

132. What is a non-clustered index?​


Answer: A non-clustered index stores a separate structure with pointers to the actual data.

133. How many clustered indexes can a table have?​


Answer: A table can usually have only one clustered index because data can be physically
sorted in only one way.

134. Can a table have multiple non-clustered indexes?​


Answer: Yes, a table can have multiple non-clustered indexes.

135. When should indexes be avoided?​


Answer: Indexes should be avoided on very small tables, columns with frequent updates, or
columns with very low uniqueness.

136. Can too many indexes reduce performance?​


Answer: Yes, too many indexes can slow down insert, update, and delete operations because
indexes must also be updated.

137. What is query optimization?​


Answer: Query optimization means improving query performance by reducing execution time
and resource usage.

138. What is an execution plan?​


Answer: An execution plan shows how the database engine plans to execute a query.

139. What is a table scan?​


Answer: A table scan means the database checks every row in a table. It can be slow for large
tables.

140. What is the difference between index scan and index seek?​
Answer: Index seek directly finds matching rows using an index. Index scan reads a larger
portion of the index.

141. Why should SELECT * be avoided?​


Answer: SELECT * retrieves unnecessary columns, increases load, slows performance, and
makes queries less readable.

Transactions and ACID


142. What is a transaction?​
Answer: A transaction is a logical unit of work that must be completed fully or not at all.

143. Why are transactions important?​


Answer: Transactions ensure data reliability, especially when multiple changes must happen
together.

144. What are ACID properties?​


Answer: ACID stands for Atomicity, Consistency, Isolation, and Durability. These properties
ensure reliable transaction processing.

145. What is Atomicity?​


Answer: Atomicity means a transaction is completed fully or not executed at all.

146. What is Consistency?​


Answer: Consistency means a transaction moves the database from one valid state to another
valid state.

147. What is Isolation?​


Answer: Isolation means transactions should not interfere with each other while executing.

148. What is Durability?​


Answer: Durability means once a transaction is committed, the changes are permanently saved.

149. What is COMMIT?​


Answer: COMMIT permanently saves the changes made in a transaction.

150. What is ROLLBACK?​


Answer: ROLLBACK undoes changes made in a transaction before they are committed.

151. What is SAVEPOINT?​


Answer: SAVEPOINT creates a point within a transaction to which we can roll back if needed.

Locking and Isolation


152. What is locking in SQL?​
Answer: Locking controls access to data when multiple users or transactions are working at the
same time.

153. Why is locking required?​


Answer: Locking prevents data conflicts, incorrect updates, and inconsistent results.
154. What is a deadlock?​
Answer: A deadlock happens when two transactions wait for each other to release resources,
and neither can continue.

155. What are isolation levels?​


Answer: Isolation levels define how much one transaction can see changes made by another
transaction.

156. What is dirty read?​


Answer: Dirty read happens when a transaction reads uncommitted data from another
transaction.

157. What is non-repeatable read?​


Answer: Non-repeatable read happens when the same query returns different results within the
same transaction because another transaction modified the data.

158. What is phantom read?​


Answer: Phantom read happens when new rows appear in repeated queries within the same
transaction due to another transaction’s insert operation.

Views, Procedures and Functions


159. What is a view?​
Answer: A view is a virtual table based on a SQL query. It does not usually store data physically.

160. Why are views used?​


Answer: Views simplify complex queries, improve readability, restrict access to sensitive
columns, and support reporting.

161. What is a stored procedure?​


Answer: A stored procedure is a saved SQL program that can be executed whenever needed.

162. Why are stored procedures used?​


Answer: Stored procedures help reuse logic, improve consistency, and reduce repeated coding.

163. What is a function in SQL?​


Answer: A function is a reusable database object that returns a value.

164. What is the difference between procedure and function?​


Answer: A function must return a value, while a procedure may or may not return a value.

165. What is a temporary table?​


Answer: A temporary table stores data temporarily during a session or transaction.
166. What is the difference between temporary table and CTE?​
Answer: A CTE exists only for a single query, while a temporary table can be reused in multiple
queries during the same session.

167. What is a materialized view?​


Answer: A materialized view stores query results physically. It is useful for improving
performance in repeated reporting queries.

168. What is the difference between view and materialized view?​


Answer: A view does not store data physically, while a materialized view stores the result and
may need refreshing.

SQL Dialects
169. What is SQL dialect?​
Answer: SQL dialect refers to database-specific versions of SQL. Different databases have
slightly different syntax and functions.

170. What is the difference between MySQL, SQL Server, PostgreSQL, and Oracle SQL?​
Answer: They are different relational database systems. Core SQL concepts are similar, but
functions, syntax, and advanced features may differ.

171. What is the difference between LIMIT and TOP?​


Answer: LIMIT is used in MySQL and PostgreSQL to restrict rows, while TOP is used in SQL
Server.

172. What is the difference between NVL, ISNULL, and COALESCE?​


Answer: All handle NULL values. NVL is common in Oracle, ISNULL in SQL Server, and
COALESCE is standard SQL.

173. What is auto-increment?​


Answer: Auto-increment automatically generates a new numeric value for each inserted record,
usually for ID columns.

Business Analytics and MBA-Relevant SQL Questions


174. Why is SQL important for MBA students?​
Answer: SQL helps MBA students work directly with business data. It is useful in analytics,
marketing, finance, HR, operations, consulting, and reporting roles.
175. Why do business analysts need SQL?​
Answer: Business analysts need SQL to extract, clean, summarize, and analyze data from
company databases.

176. How does SQL support decision-making?​


Answer: SQL helps convert raw data into insights such as revenue trends, customer behavior,
campaign performance, cost analysis, and employee performance.

177. How does SQL help in dashboard creation?​


Answer: SQL prepares clean and structured data that can be used in dashboard tools like
Power BI, Tableau, Looker, or Excel.

178. What type of SQL knowledge is expected from MBA freshers?​


Answer: MBA freshers are usually expected to know SELECT, WHERE, JOIN, GROUP BY,
HAVING, subqueries, CTEs, basic window functions, CASE WHEN, and date functions.

179. Why is SQL better than Excel for large datasets?​


Answer: SQL can handle large datasets more efficiently, automate repeated queries, join
multiple tables, and reduce manual errors.

180. Is Excel still useful if someone knows SQL?​


Answer: Yes, Excel is useful for quick analysis and presentation, while SQL is better for
extracting and preparing data from databases.

181. What is the role of SQL in Power BI or Tableau?​


Answer: SQL helps prepare, filter, join, and aggregate data before visualization in Power BI or
Tableau.

182. Should all calculations be done in SQL before dashboarding?​


Answer: Not always. Heavy cleaning and aggregation can be done in SQL, while interactive
calculations can be done in dashboard tools.

183. What is raw data?​


Answer: Raw data is detailed transaction-level data that has not yet been cleaned, summarized,
or transformed.

184. What is summary data?​


Answer: Summary data is aggregated data, such as total sales by month or average salary by
department.

185. What is KPI tracking in SQL?​


Answer: KPI tracking means calculating business measures such as revenue, profit, conversion
rate, attrition rate, and average order value using SQL.
Sales Analytics Concepts
186. How can SQL help in sales analytics?​
Answer: SQL can analyze sales revenue, product performance, salesperson performance,
region-wise sales, customer purchase patterns, and sales trends.

187. What is average order value?​


Answer: Average order value is the average amount spent per order. It helps understand
customer spending behavior.

188. What is sales contribution percentage?​


Answer: Sales contribution percentage shows how much each product, region, or salesperson
contributes to total sales.

189. What are slow-moving products?​


Answer: Slow-moving products are products with low sales over a specific period. SQL can help
identify them for inventory decisions.

190. What is sales trend analysis?​


Answer: Sales trend analysis studies how sales change over time, such as daily, monthly,
quarterly, or yearly patterns.

Marketing Analytics Concepts


191. How can SQL help in marketing analytics?​
Answer: SQL can analyze leads, campaigns, conversions, customer sources, cost per lead, and
campaign performance.

192. What is conversion rate?​


Answer: Conversion rate is the percentage of leads or visitors who complete a desired action,
such as purchase or registration.

193. What is cost per lead?​


Answer: Cost per lead is the marketing cost divided by the number of leads generated.

194. What is cost per conversion?​


Answer: Cost per conversion is the marketing cost divided by the number of successful
conversions.

195. Why is source-wise lead analysis important?​


Answer: It helps identify which channels, such as Facebook, LinkedIn, Google, or referrals,
generate better leads.
Customer Analytics Concepts
196. How can SQL help in customer analytics?​
Answer: SQL can identify customer segments, repeat customers, inactive customers, high-value
customers, and customer lifetime value.

197. What is customer segmentation?​


Answer: Customer segmentation means dividing customers into groups based on behavior,
value, location, purchase frequency, or other characteristics.

198. What is customer lifetime value?​


Answer: Customer lifetime value is the total value a customer generates for a business over the
entire relationship.

199. What is a repeat customer?​


Answer: A repeat customer is someone who has purchased more than once.

200. What is an inactive customer?​


Answer: An inactive customer is someone who has not purchased or interacted with the
business for a defined period.

201. Why is customer retention important?​


Answer: Retention is important because keeping existing customers is usually cheaper than
acquiring new customers.

Finance Analytics Concepts


202. How can SQL help in finance analytics?​
Answer: SQL can analyze revenue, expenses, profit, budget variance, department-wise cost,
and financial trends.

203. What is budget variance?​


Answer: Budget variance is the difference between budgeted amount and actual amount.

204. What is profit margin?​


Answer: Profit margin shows what percentage of revenue remains as profit after costs.

205. What is expense trend analysis?​


Answer: Expense trend analysis studies how expenses change over time, helping control costs.
206. Why is SQL useful for financial reporting?​
Answer: SQL helps extract accurate and structured financial data for reports, dashboards, and
decision-making.

HR Analytics Concepts
207. How can SQL help in HR analytics?​
Answer: SQL can analyze employee count, attrition, average salary, department strength,
performance, hiring, and promotion eligibility.

208. What is attrition rate?​


Answer: Attrition rate measures the percentage of employees who leave an organization during
a specific period.

209. Why is department-wise attrition analysis important?​


Answer: It helps identify departments where employee exits are unusually high and may need
management attention.

210. What is salary benchmarking?​


Answer: Salary benchmarking compares salaries across employees, departments, roles, or
market standards.

211. How can SQL support performance analysis?​


Answer: SQL can summarize performance scores, identify high performers, compare
departments, and support promotion decisions.

Operations and Supply Chain Concepts


212. How can SQL help in operations analytics?​
Answer: SQL can analyze inventory, delivery delays, supplier performance, order fulfillment, and
operational efficiency.

213. What is inventory analysis?​


Answer: Inventory analysis studies stock levels, slow-moving items, fast-moving items, and
reorder requirements.

214. What is supplier performance analysis?​


Answer: Supplier performance analysis evaluates vendors based on delivery time, quality,
quantity, and reliability.
215. What is delivery delay analysis?​
Answer: Delivery delay analysis identifies late deliveries and helps understand vendor or
logistics performance.

216. Why is SQL useful in supply chain analytics?​


Answer: SQL helps track products, suppliers, inventory, orders, shipments, and delays across
large operational datasets.

Interview-Focused Conceptual Questions


217. What makes someone strong in SQL interviews?​
Answer: Strong SQL candidates understand joins, grouping, filtering, subqueries, window
functions, NULL handling, and business problem-solving.

218. What are common mistakes in SQL interviews?​


Answer: Common mistakes include wrong join conditions, ignoring NULL values, using WHERE
instead of HAVING, and not understanding duplicates.

219. How should a student approach a SQL interview question?​


Answer: First understand the business requirement, identify the required tables, decide joins
and filters, then explain the logic clearly.

220. Why is explanation important in SQL interviews?​


Answer: Interviewers do not only check the final answer. They also check whether the candidate
understands the logic and business meaning.

221. What is analytical SQL?​


Answer: Analytical SQL is used for reporting, summaries, trends, ranking, segmentation, and
decision-making.

222. What is transactional SQL?​


Answer: Transactional SQL is used for day-to-day data operations such as inserting, updating,
and deleting records.

223. What is the difference between analytical and transactional SQL?​


Answer: Transactional SQL focuses on operations, while analytical SQL focuses on insights,
reporting, and business decisions.

224. What is data cleaning in SQL?​


Answer: Data cleaning in SQL means handling missing values, duplicates, inconsistent formats,
invalid records, and incorrect categories.
225. Why is data cleaning important before analysis?​
Answer: Poor data quality can produce wrong insights, incorrect KPIs, and misleading business
decisions.

226. What is data redundancy?​


Answer: Data redundancy means the same data is stored in multiple places. It can cause
inconsistency if not managed properly.

227. What is data integrity?​


Answer: Data integrity means data is accurate, consistent, complete, and reliable.

228. What is data consistency?​


Answer: Data consistency means the same data should not show different values in different
places.

229. What is data duplication?​


Answer: Data duplication means the same record appears more than once in a dataset.

230. Why are duplicate records a problem?​


Answer: Duplicate records can inflate counts, revenue, customer numbers, and other business
metrics.

231. What is an outlier in data?​


Answer: An outlier is an unusually high or low value compared to the rest of the data.

232. Can SQL help detect outliers?​


Answer: Yes, SQL can help identify unusually high or low values using aggregation, ranking,
and comparison logic.

Final MBA Student-Focused Questions


233. Why should MBA students learn SQL before Power BI?​
Answer: SQL helps students understand where data comes from and how it is prepared. Power
BI is stronger when the backend data is clean and structured.

234. Is SQL useful for marketing students?​


Answer: Yes, SQL is useful for campaign analysis, customer segmentation, lead analysis,
conversion tracking, and digital marketing reporting.

235. Is SQL useful for finance students?​


Answer: Yes, SQL is useful for expense analysis, revenue reporting, variance analysis,
profitability analysis, and financial dashboards.
236. Is SQL useful for HR students?​
Answer: Yes, SQL is useful for attrition analysis, employee performance tracking, salary
analysis, recruitment reports, and workforce planning.

237. Is SQL useful for operations students?​


Answer: Yes, SQL is useful for inventory analysis, vendor analysis, delivery tracking, supply
chain reporting, and process efficiency analysis.

238. What level of SQL is enough for MBA analytics roles?​


Answer: MBA students should be strong in basic to intermediate SQL, especially joins,
aggregation, subqueries, CTEs, window functions, date functions, and business scenario
interpretation.

239. What is the most important SQL skill for MBA students?​
Answer: The most important skill is converting a business question into a SQL logic. Syntax is
important, but business interpretation is more valuable.

240. What is the final purpose of SQL in business analytics?​


Answer: The final purpose of SQL is to turn raw business data into meaningful insights that
support better decisions.

You might also like