0% found this document useful (0 votes)
52 views

7 Days Analytics Course 3feiz7 1

This document provides a list of SQL tricky interview questions and answers. It covers topics like SQL components, data types, joins, indexes, normalization, stored procedures, triggers and other concepts to help prepare for SQL interviews.

Uploaded by

anupamakarupiah
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)
52 views

7 Days Analytics Course 3feiz7 1

This document provides a list of SQL tricky interview questions and answers. It covers topics like SQL components, data types, joins, indexes, normalization, stored procedures, triggers and other concepts to help prepare for SQL interviews.

Uploaded by

anupamakarupiah
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
You are on page 1/ 8

1

Day wise Topic (Get the complete book by emailing to [email protected])

Day 1 - SQL Tricky Interview Questions 3


Day 2 - Python Round 1 Questions 10
Day 3 - Pandas Round 1 Questions 23
Day 4 - Numpy Interview Questions 33
Day 5 - Case Studies 47
Day 6 - Big Data Technologies 88
Day 7 - Guesstimate Interview Questions 93
Day 8 - How to create a resume? 100
Day 9 - SQL Intermediate Interview Questions 102
Day 10 - Pandas and Python Moderate Questions 110
Day 11 - Machine Learning Tricky Interview Questions 119
Day 12 - Statistics Tricky Interview Questions 131
Day 13 - Data Pipeline Interview Questions 137
Day 14 - Regular Expression Intervie Questions 146
Day 15 - SQL Advance interview Questions 155
Day 16 - Python and Pandas Advance Interview Questions 159
Day 17 - MS Excel 163
Day 18 - Amazon Web Services 173
Day 19 - Terminal Commands 189
Day 20 - Power BI DAX 193
Day 21 - EDA in Python 211
Day 22 - Data Preprocessing in Python 217
Day 23 - Data Visualisation in Python 221
Day 24 - SQL Query Optimisaiton Techniques 222
Day 25 - Data Cleaning in Python and SQL 225
Day 26 - Regression Interview Questions 229
Day 27 - Forecasting Interview Questions 240
Day 28 - Shell Scripting Code and Overview 248
Day 29 - Natural Language Processing 255
Day 30 - Big Data Interview Questions 261
2

How to use this e-book?

The Data Monk is a group of 50+ Individual working for


3

Day 1 - SQL Tricky Interview Questions

1. What is SQL, and what are its different components?

SQL (Structured Query Language) is a domain-specific language used for managing and
manipulating data in relational database management systems (RDBMS). Its different
components include Data Definition Language (DDL), Data Manipulation Language (DML), Data
Control Language (DCL), and Transaction Control Language (TCL).

2. What is the difference between SQL and MySQL?

SQL is a language used to manage and manipulate data in a database, whereas MySQL is an
open-source relational database management system that uses SQL as its language.

3. What are the different types of SQL commands?

The different types of SQL commands include DDL (Data Definition Language), DML (Data
Manipulation Language), DCL (Data Control Language), and TCL (Transaction Control
Language).

4. What is a primary key?

A primary key is a column or group of columns that uniquely identifies each row in a table. It
must contain unique values and cannot have NULL values.

5. What is a foreign key?

A foreign key is a column or a group of columns in a table that references the primary key of
another table. It establishes a link between the data in the two tables.

6. What is the difference between CHAR and VARCHAR data types?

The main difference between CHAR and VARCHAR data types is that CHAR is a fixed-length
character data type, whereas VARCHAR is a variable-length character data type.

7. What is the difference between DELETE and TRUNCATE commands?

DELETE is a DML command used to remove specific rows from a table, while TRUNCATE is a
DDL command used to remove all rows from a table.
4

8. What is the difference between UNION and UNION ALL?

UNION is used to combine the result sets of two or more SELECT statements and removes
duplicate rows, whereas UNION ALL also combines the result sets but retains all rows, including
duplicates.

9. What is an index in SQL?

An index is a data structure that improves the speed of data retrieval operations on a database
table. It is used to quickly locate data without having to search every row in a database table.

10. What is a stored procedure?

A stored procedure is a prepared SQL code that can be saved and reused. It allows you to
group multiple SQL statements into a single unit and execute them whenever required.

11. What is a view in SQL?

A view in SQL is a virtual table that is based on the result set of a SELECT statement. It
contains rows and columns similar to a real table but does not store any data of its own.

12. What is normalization in SQL, and why is it important?

Normalization is the process of organizing data in a database to reduce data redundancy and
improve data integrity. It helps in eliminating data anomalies and inconsistencies.

13. What is denormalization?

Denormalization is the process of adding redundant data to a normalized database to improve


the performance of read operations. It involves introducing redundancy to reduce the number of
joins needed to retrieve data.

14. What is the difference between INNER JOIN and OUTER JOIN?

An INNER JOIN returns only the rows that have matching values in both tables, while an
OUTER JOIN returns all the rows from one or both of the tables being joined, based on whether
the condition is met or not.

15. Explain the different types of joins in SQL.

The different types of joins in SQL include INNER JOIN, LEFT JOIN (or LEFT OUTER JOIN),
RIGHT JOIN (or RIGHT OUTER JOIN), and FULL JOIN (or FULL OUTER JOIN).
5

16. What is a subquery?

A subquery is a query nested within another SQL query. It is used to return data that will be
used in the main query as a condition to further restrict the data to be retrieved.

17. What is a self-join?

A self-join is a regular join, but the table is joined with itself. It is particularly useful when a table
has a foreign key that references its own primary key.

18. What is the difference between a primary key and a unique key?

A primary key is a column or group of columns that uniquely identifies each row in a table and
does not allow NULL values, while a unique key ensures that all values in a column are
different. Unlike the primary key, it allows NULL values.

19. How to find the second highest salary from an employee table?

To find the second highest salary from an employee table, you can use the following SQL query:

SELECT MAX(salary)
FROM employee
WHERE salary < (SELECT MAX(salary) FROM employee);

20. What is ACID property in a database?

ACID (Atomicity, Consistency, Isolation, Durability) is a set of properties that guarantee the
reliability of database transactions. Atomicity ensures that all operations within a transaction are
completed successfully; Consistency ensures that the database remains in a valid state before
and after the transaction; Isolation ensures that the concurrent execution of transactions results
in a system state that would be obtained if transactions were executed serially; and Durability
ensures that once a transaction has been committed, it will remain so even in the case of
system failure.

21. What is a trigger in SQL?

A trigger in SQL is a set of SQL statements that automatically "fires" or executes when a
specified event occurs, such as when data is modified in a table.
6

22. What is the difference between a function and a stored procedure?

A function in SQL is a set of SQL statements that can accept input parameters, perform actions,
and return a value. A stored procedure, on the other hand, can perform a series of SQL
operations and may or may not return a value.

23. What is the difference between clustered and non-clustered indexes?

A clustered index determines the physical order of data in a table, while a non-clustered index
does not alter the physical order of the table and creates a separate structure to store the
indexed columns.

24. What is the GROUP BY clause used for?

The GROUP BY clause is used in SQL to group rows that have the same values into summary
rows, such as "sum," "count," "avg," "min," or "max" to apply functions to each group.

25. What is the HAVING clause in SQL?

The HAVING clause is used in combination with the GROUP BY clause to filter records that are
returned by a GROUP BY clause.

26. What is a composite key?

A composite key is a combination of two or more columns that uniquely identifies each row in a
table. Each column may not be unique by itself, but the combination of columns is unique.

27. What is a CTE (Common Table Expression) in SQL?

A Common Table Expression (CTE) is a temporary result set that can be referenced within the
context of a SELECT, INSERT, UPDATE, or DELETE statement.

28. Explain the concept of data integrity in SQL.

Data integrity in SQL refers to the accuracy and consistency of data stored in a database. It
ensures that data remains accurate, reliable, and accessible over time.

29. What is a constraint in SQL?

A constraint in SQL is a rule that is enforced on the data in a table. It can be used to enforce
data integrity and to ensure that data meets certain criteria.
7

30. What is the difference between a candidate key and a composite key?

A candidate key is a column or a set of columns that can uniquely identify any row in a table,
while a composite key is a combination of two or more columns that can uniquely identify any
row in a table.

31. What is the difference between a cursor and a trigger?

A cursor is a database object that allows traversal over the rows of a result set, while a trigger is
a set of SQL statements that automatically execute or fire when a specified event occurs.

32. What are the different types of constraints in SQL?

The different types of constraints in SQL include NOT NULL, UNIQUE, PRIMARY KEY,
FOREIGN KEY, and CHECK constraints.

33. What is the difference between a unique constraint and a primary key?

A unique constraint ensures that all values in a column are different, while a primary key is a
column or a set of columns that uniquely identifies each row in a table and does not allow NULL
values.

What is the difference between a clustered and a non-clustered index?

A clustered index determines the physical order of data in a table, while a non-clustered index
does not alter the physical order of the table and creates a separate structure to store the
indexed columns.

What is the difference between a LEFT JOIN and a RIGHT JOIN?

A LEFT JOIN returns all rows from the left table and the matched rows from the right table, while
a RIGHT JOIN returns all rows from the right table and the matched rows from the left table.

What is a natural join in SQL?

A natural join in SQL is a type of join that combines columns with the same name in both tables,
eliminating duplicate columns.

What is the difference between a self-join and an inner join?

An inner join is a join that returns only the rows with matching values in both tables, while a
self-join is a join that joins a table with itself.
8

What is a cross join in SQL?

A cross join in SQL is a join that produces the Cartesian product of the two tables involved.

What is a temporary table in SQL?

A temporary table in SQL is a table that exists temporarily and holds a subset of data from
another table. It is automatically dropped when the session that created it ends.

What is the difference between a temporary table and a table variable?

A temporary table is a physical table that exists for the duration of a session, while a table
variable is a variable that can hold a set of data and exists for the duration of a batch,
procedure, or function.

What is the difference between a stored procedure and a user-defined function?

A stored procedure is a set of SQL statements that can be saved and reused, while a
user-defined function is a set of SQL statements that returns a value and can be used in SQL
statements wherever expressions are allowed.

What is the difference between a view and a table?

A view in SQL is a virtual table based on the result set of a SELECT statement, while a table is
a collection of data organized into rows and columns.

What is the purpose of the ORDER BY clause in SQL?

The ORDER BY clause is used to sort the result set of a SELECT statement in either ascending
or descending order based on one or more columns.

What is the purpose of the DISTINCT keyword in SQL?

The DISTINCT keyword in SQL is used to retrieve unique values from a column or set of
columns in a table.

What is the purpose of the BETWEEN operator in SQL?

The BETWEEN operator in SQL is used to retrieve values within a specific range.

What is the difference between the LIKE and the IN operator in SQL?

The LIKE operator is used for pattern matching, while the IN operator is used to specify multiple
values in a WHERE clause.

You might also like