top of page
  • Writer's pictureTalent Cluster

6 SQL Interview Questions That You Should Know

Updated: Apr 6, 2022

Talent Cluster is launching a data tech world series to provide high demand interview questions and answer acquisition for job seekers. We truly believe these interview questions will be asked during your conversation with employers.

Question 1: What is an index?

Indexes support the Data Analyst to speed up searching the result in the database. It is used to find all rows matching with some columns and then to skim through only those subsets of the data to find the matches.

Question 2: What types of index do you know?

Clustered index: It is used to sort the rows of data by their key values. A clustered index is like the contents of a phone book. We can open the book at ‘David’ (for ‘David, Thompson’) and find information for all Davids right next to each other. Since the data is located next to each other, it helps a lot in fetching data based on range-based queries. Also, the clustered index is actually related to how the data is stored. There is only one clustered index possible per table.

Non-clustered index: It stores data at one location and indexes at some other location. The index has pointers that point to the location of the data. As the index in the non-clustered index is stored in different places, there can be many non-clustered indexes for a table.

Question 3: What is the difference between DELETE and TRUNCATE commands?

DELETE: This query is used to delete or remove one or more existing tables.

TRUNCATE: This statement deletes all the data from inside a table.

Question 4: What is Normalisation?

It is used in reducing data redundancy and dependency by organising fields and tables in databases. It involves constructing tables and setting up relationships between those tables according to certain rules. The redundancy and inconsistent dependency can be removed using these rules to make it more flexible.

Question 5: What is Denormalisation?

It is contrary to normalisation. In this, we basically add redundant data to speed up complex queries involving multiple tables to join. Here, we attempt to optimize the read performance of a database by adding redundant data or by grouping the data.

Question 6: What is the unique index?

UNIQUE INDEX is used to enforce the uniqueness of values in single or multiple columns. We can create more than one unique index in a single table. For creating a unique index, the user has to check the data in the column because the unique indexes are used when any column of the table has unique values. This indexing does not allow the field to have duplicate values if the column is unique indexed. A unique index can be applied automatically when a primary key is defined.

In our next couple of series, we will keep posting popular SQL questions collecting from 700+ interviewees, hope these interview questions can give you a clear preparation path. If you would like to make some contribution or share with us what you like to learn in our tech world, please submit your voice in the below form submission.

100 views0 comments


bottom of page